|
||
|
|
#1 (permalink) |
|
Forum Expert
Join Date: Oct 2002
Location: Germany (american though)
Age: 32
Posts: 957
|
took me a while to figure this out. Someone out there might be looking for a contribution like this.
lets use the text "parsing a string" for this example. Code:
// set up the temporary string string tempstring = "parsing a string"; // set up your split delimiter string[] split = tempname.Split( ' ' ); // in this case, a blank space from.SendMessage(split[0]); // sends "parsing" from.SendMessage(split[1]); // sends "a" from.SendMessage(split[2]); // sends "string" Code:
// set up the temporary string string tempstring = "just another ~ example"; // set up your split delimiter string[] split = tempname.Split( '~' ); // in this case, ~ string firsthalf = split[0]; firsthalf = firsthalf.Trim();// you want to trim the blank space off the end string secondhalf = split[1]; secondhalf = secondhalf.Trim();// you want to trim the blank space off the beginning from.SendMessage(firsthalf); // sends "just another" from.SendMessage(secondhalf); // sends "example" **edit** trimmed the wrong way |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|