Convert 2 lines to one - Printable Version +- BP Forums (https://bpforums.info) +-- Forum: Archived Forums (https://bpforums.info/forumdisplay.php?fid=55) +--- Forum: Archived Forums (https://bpforums.info/forumdisplay.php?fid=56) +---- Forum: VB.NET (Visual Basic 2010/2008) (https://bpforums.info/forumdisplay.php?fid=8) +----- Forum: Programming Help (https://bpforums.info/forumdisplay.php?fid=9) +----- Thread: Convert 2 lines to one (/showthread.php?tid=747) |
Convert 2 lines to one - brco900033 - 02-21-2013 Sorry I couldn't find a better title for this topic. Basically what I want to do is convert 2 lines to one. I have: btn_ 1 but it has to be: btn_1 Probably there will be an easy solution but honestly I didn't found one on the internet. Re: Convert 2 lines to one - brandonio21 - 02-21-2013 Well you could always press the backspace key... Or, you can do something like this [code2=vbnet]Public Function OneLine(ByVal toFix As String) As String Dim returnString As String = "" Dim lines() As String = toFix.Split(vbNewLine) For Each line As String In lines returnString = returnString & line Next Return returnString End Function[/code2] Re: Convert 2 lines to one - brco900033 - 02-23-2013 Thanks for the tip. I never used the backspace before! <!-- shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt="hock:" title="Shocked" /><!-- shock: --> Thanks for the code snippet, I'll test it tomorrow. |