Solved

Splitting a Piped String Help

Posted on 2006-07-19
2
207 Views
Last Modified: 2010-04-16
Hello all.  I have a dropdown that my 0 index has a piped account number like 112121|321333|343242.  I need to somehow loop through and grab each number and then use it in a call.  Can anyone give me help with this.  Its in a SelectedValue
0
Comment
Question by:sbornstein2
2 Comments
 
LVL 18

Accepted Solution

by:
Ravi Singh earned 500 total points
ID: 17140827
Hi, use the split method and specify a delimiter, it'll return a string array with each number on a seperate index:

string accountNumbers = this.comboBox1.SelectedValue.ToString(); //get the value
string[] accountNumberArray = accountNumbers.Split('|'); //split it

foreach (string actNum in accountNumberArray) //loop through array
{
     //use actNum here
}
0
 

Author Comment

by:sbornstein2
ID: 17141311
thank you so much
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

860 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