Translate

Saturday, 25 April 2015

c# Join and Split String

 string[] Arr = { "Microsoft", "IBM", "Oracle" };    
        // ... Join strings into a single string.
        string joinedString = string.Join("|", Arr);
        Response.Write("joined :"+"<br>");
        Response.Write(joinedString + "<br>");// Result Microsoft|IBM|Oracle
        Response.Write("Splits :" + "<br>");
        string[] SplitArr = joinedString.Split('|');
        Response.Write(SplitArr[0]);// Result Microsoft

No comments:

Post a Comment