Solved

Need help with a string operation.

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

Suggested Solutions

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.

832 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