Solved

C# String Split

Posted on 2013-12-18
2
523 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
ID: 39726817
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
ID: 39727005
Thanks.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

785 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