Solved

C# String Split

Posted on 2013-12-18
2
517 Views
Last Modified: 2013-12-18
Hello,

C# - I need to split the below string:

Kwynce Brookins (001091)
Tre Brookins (001089)
Kent Hood (001267)

and get the output shown below :

001091,001089,001267

the input values are in Ilist and I am looping them...

Any idea?

Thanks
0
Comment
Question by:mani_sai
2 Comments
 
LVL 15

Accepted Solution

by:
Minh Võ Công earned 500 total points
Comment Utility
public string extracString(string intStr)
    {
        char[] delimiterChars = { '(', ')'};
        string[] words = intStr.Split(delimiterChars);
        return words[1];
    }
now you call  extracString("Kwynce Brookins (001091)") return 001091 and so on
0
 
LVL 8

Author Comment

by:mani_sai
Comment Utility
Thanks.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This video discusses moving either the default database or any database to a new volume.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now