Solved

Splitting a Piped String Help

Posted on 2006-07-19
2
205 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C# Offline Apllication 5 55
Error when loading the database 16 57
Not showing JavaScript in the list 5 39
System.Speech 2 16
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
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…
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.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

896 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

16 Experts available now in Live!

Get 1:1 Help Now