c# - Split a string by a character -


i have string here:

string filenameorginal = "lighthouse-126.jpg"; 

and trying split string 2, seperating "-"

i have tried following, syntax error on spilt:

string filenameorginal = drproduct["producthtml"].tostring(); string[] strdataarray = filenameorginal.split("-"); 

please help, not understand doing wrong.

you need character instead of string:

string[] strdataarray = filenameorginal.split('-'); 

Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -