Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need help with a string operation.

Posted on 2016-08-19
2
Medium Priority
?
48 Views
Last Modified: 2016-08-19
Hi Experts,

I have string "PL0445796AA03ZHE_Q10_S35852592B". I want to strip it out to three different strings.
S1 ="PL0445796AA03ZHE"
S2 = "Q10"
S3 = "S35852592B"

The length of the strings might me different. But there will be always 2 underscores.

Thanks in advance.
0
Comment
Question by:RadhaKrishnaKiJaya
2 Comments
 
LVL 45

Accepted Solution

by:
AndyAinscow earned 2000 total points
ID: 41762785
string s = "PL0445796AA03ZHE_Q10_S35852592B";
            string[] sRes = s.Split('_');

sRes contains the three strings you want in an array
0
 

Author Closing Comment

by:RadhaKrishnaKiJaya
ID: 41762819
Thank you very much.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

824 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