string tokenizer
-
-
Hi, I would like to read/write a specific format to a flat text file. This format will contain delimiters like |, or space. I have been looking at the String class in C# to find somthing like string tokenizer. No any luck. Can someone help me out? Thanks!
string str = "this|is|a|test"; string[] arr = str.Split('|'); // arr == { 'this', 'is', 'a', 'test' } // alternatively... string str = "this|is,a|test"; string[] arr = str.Split('|', ','); // gives the same result.
HTH Paul -
Hi, I would like to read/write a specific format to a flat text file. This format will contain delimiters like |, or space. I have been looking at the String class in C# to find somthing like string tokenizer. No any luck. Can someone help me out? Thanks!
String.Split Method String Class | String Members | System Namespace Identifies the substrings in this instance that are delimited by one or more characters specified in an array, then places the substrings into a String array. Overload List Identifies the substrings in this instance that are delimited by one or more characters specified in an array, then places the substrings into a String array. public string[] Split(params char[]); Identifies the substrings in this instance that are delimited by one or more characters specified in an array, then places the substrings into a String array. A parameter specifies the maximum number of array elements to return. public string[] Split(char[], int); MYrc : A .NET IRC client with C# Plugin Capabilities. See http://sourceforge.net/projects/myrc for more info. :-D
-
Hi, I would like to read/write a specific format to a flat text file. This format will contain delimiters like |, or space. I have been looking at the String class in C# to find somthing like string tokenizer. No any luck. Can someone help me out? Thanks!
RegExp
"When the only tool you have is a hammer, a sore thumb you will have."