Solved

C# String Split

Posted on 2013-12-18
2
519 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

948 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

23 Experts available now in Live!

Get 1:1 Help Now