splitting strings

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
 
T

Trevor Benedict

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

Regards,

Trevor Benedict
MCSD
 
M

Milosz Skalecki [MCAD]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top