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 -

java - More than one row with the given identifier was found: 1, for class: com.model.Diagnosis -