|
-
Aug 12th, 2003, 09:39 PM
#1
Thread Starter
Registered User
Split string? [Resolved]
How can I split text inside a Textbox into a few strings, where each string can only contains exactly 5 characters?
How to avoid splitting a word into 2? for example:
origianal text is: "ONE HUNDRED NINETY"
after spliting:
1st string: "ONE H"
2nd string: "UNDRE"
3rd string: "D NIN"
4th string: "ETY"
can it detect is it's a word, it would not split it into 2? means it will stop at the space before the word, and push the word to next new string?
pls guide thank you
Last edited by albertlse; Aug 21st, 2003 at 07:55 PM.
-
Aug 12th, 2003, 09:52 PM
#2
Lively Member
ummm...
do the strings have to be variables or do you just want the text seperated?

-morrowasted
-
Aug 12th, 2003, 10:01 PM
#3
Thread Starter
Registered User
do the strings have to be variables or do you just want the text seperated?
which approach will be better? array of string? or how? pls suggest...
-
Aug 12th, 2003, 10:45 PM
#4
Originally posted by albertlse
which approach will be better? array of string? or how? pls suggest...
VB Code:
Public MyStrings As String() = Regex.Split(TextBox, " ")
That will put text into the arrow seperating them by strings.
Hope that helps
-
Aug 21st, 2003, 07:55 PM
#5
Thread Starter
Registered User
it's working fine now.... thanx
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|