Thursday, February 21, 2013

Split in C#


Return type of split  method is an array[].

General syntax : 

         StringName.Split( '(' );
Here it will seperate the string by ' ( '.

We can also use multiple parameters.

For Example: 


We have a string   a=India(IND) is my country

a= a.Split( '(' , ')' )[1];

      Now, a= IND It seperates by two unicode seperators.[ ( , ) ].

For, a= a.Split( '(' , ')' )[0];
 It will return , a= 'India'.

No comments:

Post a Comment