how to split a string in c# with string delimiter

Smith
Smith
Participant
360 Points
110 Posts

Hi,

I want to split a string by a substring as

var temp= DeliveryAddress.Split( ":::" )[0];

but it throws error.

Please help.

Views: 8162
Total Answered: 1
Total Marked As Answer: 0
Posted On: 25-Sep-2015 00:10

Share:   fb twitter linkedin
Answers
NiceOne Team
NiceOne...
Admin
408 Points
69 Posts
     

Hi Smith,

Use following code:

var temp = DeliveryAddress.Split(new string[] { ":::" }, StringSplitOptions.None)[0];
//OR
var temp1 = DeliveryAddress.Split(new [] { ":::" }, StringSplitOptions.None)[0];
Posted On: 25-Sep-2015 03:41
banner

Blog

Active User (2)

 Log In to Chat