| | |
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: 2461 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2008 access advanced application array basic beginner browser button buttons center checkbox class client code combo convert cuesent data database datagrid datagridview date datetimepicker design designer dissertation dissertations dissertationtopic eclipse excel fade filter forms generatetags gridview html images input internet lib listview map mobile monitor net number objects open panel pdf picturebox picturebox2 port position print printing problem read remove richtextbox save searchvb.net select serial settings shutdown socket sorting sqlserver studio survey temperature textbox timer timespan transparency txttoxmlconverter user usercontol validation vb vb.net vb2008 vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web webbrowser winforms winsock wpf wrapingcode year





