splitting strings

  • Thread starter Thread starter rodchar
  • Start date Start date
R

rodchar

hey all,
i have the following string value:

xx__field_name__0__0

is it possible to split the string using the double underscores?

thanks,
rodchar
 
arrVal = "xx__field_name__0__0".split("__") or something of this nature
should work.

Regards,

Trevor Benedict
MCSD
 
Hi There,

Of course you can, two ways from top of my head:

string str = "xx__field_name__0__0";
string[] result1 = str.Split(
new string[] { "__" }, StringSplitOptions.RemoveEmptyEntries);

string[] result2 = System.Text.RegularExpressions.Regex.Split(str, "__");

Hope this helps
 
Back
Top