Solved

how to extract characters pass pipe delimeted string

Posted on 2014-01-06
3
279 Views
Last Modified: 2014-01-06
My input string = ABCD|EFGH.

How do I retrieve values 'EFGH' from the input string past pipe delimeted.
0
Comment
Question by:Meinhoonaa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
Korbus earned 500 total points
ID: 39759870
somthing like this oughta do it (with a few assumptions):

String str ="abcd|efgh";
int a=str.IndexOf("|");
String final_value=str.Substring(a+1);
0
 
LVL 11

Expert Comment

by:John_Vidmar
ID: 39760057
Assumes you have a string with at least one delimeter:
string str ="abcd|efgh";
String final_value=str.Split('|')[1]

Open in new window

0
 

Expert Comment

by:Michael Reeve
ID: 39760170
Another approach might be to use LastIndexOf method which returns the last occurrence of a string or characters within the string.

string str = "ABCD|EFGH";
var stringResult = str.Substring(str.LastIndexOf('|') + 1);

Open in new window

0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

730 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