I have this string here:
String FileNameOrginal = "lighthouse-126.jpg";
and I am trying to split the string into 2, seperating it with "-"
I have tried the following, but I get a syntax error on the Spilt:
String FileNameOrginal = drProduct["productHTML"].ToString();
string[] strDataArray = FileNameOrginal.Split("-");
Please Help, I do not understand what I am doing wrong.
You just need a character instead of string:
string[] strDataArray = FileNameOrginal.Split('-');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With