| | |
How do I replace Enter
Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Jun 2008
Posts: 1
Reputation:
Solved Threads: 0
I have a headache over this one. what i am trying to do is take the text from a multi-line textbox and put it into one line so i can put that into a file for another program to read one line at a time. is there some way to do this so the file is small and streamreader can read one line at a time.
heres the code that writes to the file and compiles the textbox:
Thanks in advanced
heres the code that writes to the file and compiles the textbox:
VB.NET Syntax (Toggle Plain Text)
Dim ENTER As String = Chr(13)' I Tried vbcrlf here but it still didnt work. Dim delimiters() As Char = {CChar(ENTER)} Dim TD, D1, D2, D3, D4, inp() As String Dim ipart As IEnumerator If TextBox4.Text = Nothing Then D2 = "_" Else D2 = TextBox4.Text End If D1 = TextBox1.Text inp = TextBox2.Text.Split(delimiters) ipart = inp.GetEnumerator While ipart.MoveNext D3 = D3 & Mid(ipart.Current.ToString, 1, ipart.Current.length - 1) & "Û" End While inp = TextBox3.Text.Split(delimiters) ipart = inp.GetEnumerator While ipart.MoveNext D4 = D4 & Mid(ipart.Current.ToString, 2, ipart.Current.length) & "Û" End While sd.WriteLine(D1 & "þ" & D2 & "þ" & D3 & "þ" & D4)
Thanks in advanced
•
•
Join Date: Jun 2007
Posts: 22
Reputation:
Solved Threads: 5
The following code replaces the CR+LF that separates the lines in a multiline textbox by a text that will hopefully never be entered by any user.
I tested this with german culture settings.
I tested this with german culture settings.
VB.NET Syntax (Toggle Plain Text)
Dim sLine As String sLine = Replace(TextBox1.Text, vbCr & vbLf, ":AxAxA:") Dim writer As New StreamWriter("temp.txt", False) writer.WriteLine(sLine) writer.Close() Dim reader As New StreamReader("temp.txt") sLine = reader.ReadLine reader.Close() TextBox2.Text = Replace(sLine, ":AxAxA:", vbCr & vbLf)
Last edited by dadelsen; Jun 9th, 2008 at 4:36 am.
![]() |
Similar Threads
- Replacing "Enter" in textBox (ASP.NET)
- Error Message: No signal (Troubleshooting Dead Machines)
- subscripts & superscripts.......in php (PHP)
- replace characters (C++)
- Help with replace method. (Java)
- How do I replace worksheets in Excel? (MS Access and FileMaker Pro)
- i want the user to enter an input without obligating him to press enter (C++)
- What is BRIDGE.DLL (Viruses, Spyware and other Nasties)
Other Threads in the VB.NET Forum
- Previous Thread: Vb 4/5 to Vb.net
- Next Thread: Datagrid
Views: 2456 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
"crystal .net .net2005 30minutes 2008 access add application array assignment basic binary box button buttons center click code connectionstring convert cpu data database databasesearch datagrid datagridview design designer dissertation dissertations dissertationthesis dll dosconsolevb.net editvb.net employees error excel exists firewall folder image images isnumericfuntioncall listview login math memory mobile module msaccess mssqlbackend mysql navigate net opacity page pan peertopeervideostreaming picturebox plugin port print printing printpreview problem record refresh regex reports" reuse save savedialog serial sorting sql sqldatbase storedprocedure string structures studio temp textbox timer upload useraccounts usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet vista visual visualbasic visualbasic.net visualstudio2008 web wpf xml





