Solved

Need help with a string operation.

Posted on 2016-08-19
2
35 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
Comment Utility
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
Comment Utility
Thank you very much.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

743 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

21 Experts available now in Live!

Get 1:1 Help Now