+92 332 4229 857 99ProjectIdeas@Gmail.com

String Split Function (C#.net)





   Split a string from specified characters.





For example:

 string strOne = "Charm strikes the sight";
        string[] newStr = strOne.Split(' '); // splitting a string at every space
 string str = null;

   for (int i = 0; i < newStr.Length; i++)
          {
                str += newStr[i]; //concatenates the whole string[] to string

   }
                MessageBox.Show(str);


Output:
                     
           Charmstrikesthesight  (because all spaces are gone due to splitting the string at every space)



0 comments: