string tokenize
-
char[] delimiters = { ',', '#', ';', ' ', '/', '\0', '&', '-' }; strTemp = a[i].Split(delimiters, StringSplitOptions.RemoveEmptyEntries); #69;xx street;yy city(input) given the above input, it should split based on the delimiter... the above code removes the delimiter...but the delimiters should be retained... is there any method to do this... thanks in advance
the quieter u become more u hear
-
char[] delimiters = { ',', '#', ';', ' ', '/', '\0', '&', '-' }; strTemp = a[i].Split(delimiters, StringSplitOptions.RemoveEmptyEntries); #69;xx street;yy city(input) given the above input, it should split based on the delimiter... the above code removes the delimiter...but the delimiters should be retained... is there any method to do this... thanks in advance
the quieter u become more u hear
You could go through the result, appending the delimiter. Of course, you'd have to use the delimiters one by one. Or write your own method. Regex may work as well, not totally sure.
Cheers, Vıkram.
I've never ever worked anywhere where there has not been someone who given the choice I would not work with again. It's a job, you do your work, put up with the people you don't like, accept there are probably people there that don't like you a lot, and look forward to the weekends. - Josh Gray.
-
char[] delimiters = { ',', '#', ';', ' ', '/', '\0', '&', '-' }; strTemp = a[i].Split(delimiters, StringSplitOptions.RemoveEmptyEntries); #69;xx street;yy city(input) given the above input, it should split based on the delimiter... the above code removes the delimiter...but the delimiters should be retained... is there any method to do this... thanks in advance
the quieter u become more u hear
bool chkspchar = Regex.IsMatch(txtBrandName.Text, "[^A-Za-z0-9-]+"); if(!chkspchar) { strBrandName = Regex.Replace(txtBrandName.Text, "[^A-Za-z0-9-]+", "").Trim().ToLower(); }