467,142 Members | 1,322 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,142 developers. It's quick & easy.

Parsing user input from a textbox in vb.net

hello VB masters I have an issue that I am hoping you can help me with.
I am creating an application that accepts user input via a richtextbox.
the user can enter multiple entries and I need to parse the information
and account for whitespaces, newlines etc. I am hoping that the user
enters one per line but that is not always the case. the input would
look something like this

abc
def
hij

right now I am parsing the input with a regex and splitting it into a
string array but I do not know how to account for the carrige returns
in the richtextbox. Here is the line I am using to gather the user
input.

Dim myArray As String() = Regex.Replace(Trim(TestAcctWin.Text),
"\s+|\s", "|").Split("|")

this successfully parses everything I need but I get two empty elements
in the array depending if the user enters a carrige return on a line by
its self. how do I replace the carrige returns in a richtextbox with
spaces? I have tried replacing \n\r and \r\n and have not been
successful. if I could replace the carriges with spaces before my split
line then I believe it will work.

thanks!

Feb 3 '06 #1
  • viewed: 1701
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Peter Scott | last post: by
8 posts views Thread by Gerrit Holl | last post: by
10 posts views Thread by sqlboy2000 | last post: by
4 posts views Thread by wrytat | last post: by
5 posts views Thread by gamehack | last post: by
13 posts views Thread by Chris Carlen | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.