Link to home
Start Free TrialLog in
Avatar of fwstealer
fwstealerFlag for United States of America

asked on

csharp split string

need to get this right:

string getVal = ddlSNRN.SelectedValue.ToString(); //1043...N180HM
            string[] partsOfGetVal;
            partsOfGetVal = getVal.Split("...".ToCharArray());
            string sn = partsOfGetVal[0]; //1043
            string no = partsOfGetVal[1]; //

no seems to be returning nothing
ASKER CERTIFIED SOLUTION
Avatar of wdosanjos
wdosanjos
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Kyle Abrahams, PMP
getVal.Split("...".ToCharArray());


.ToChar Array is seperating out the ... to individual "."

Removing the empty entries will work.  

The Value can be found in [3] using the current code.