Solved

Need help with a string operation.

Posted on 2016-08-19
2
42 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 44

Accepted Solution

by:
AndyAinscow earned 500 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

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

838 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