Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 12th, 2006, 08:43 AM
Registered User
 
Join Date: May 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Separating parts of a string and assigning them to

Hi

Kindly note that I have an array string in which I store the string and split it with the help of a Delimiter ' | ' SO once the string is split,I need to assign the separated values in different variables...Please note I cannot declare the no of variables coz,I dunno how many values will be returning at Run time. So can somebody plz advise me as to how to store these values in different variables or array strings.

I am pasting the code below....


                                                               string formno = up.getUserPrivileges(uid);
string[] splits=null;
string strFinal=null;
if(formno!=null)
{
splits = formno.Split('|');
for(int i=0;i<splits.Length-1;i++)
{
strFinal=splits[i];
}


"formno" contains the string to be split....and "splits" contains the separated file with the delimiter.
Please let me know abt this at ur earliest. Thank You !

         ...Anubandh

P.S. "strFinal" keeps on overwriting the split value if there are more than one entry. In this case I need all the records to be stored in different variables.


 
Old May 12th, 2006, 12:47 PM
Authorized User
 
Join Date: Apr 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you already have an array with all splited strings, why do you need to assign to different string variables?

You need to tell more about the purpose of this... Is to assign in controls?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Separating strings and replacing characters sunrain XSLT 4 April 7th, 2008 09:33 AM
Assigning string to a number field p_gauri7 Crystal Reports 3 December 10th, 2004 10:43 AM
Calendar Control 9 .. separating date vars Chantale Access VBA 2 December 2nd, 2004 03:57 PM
Separating a field into two fields tp194 Access 1 October 8th, 2004 10:02 AM
Assigning value to string shabboleth Beginning PHP 4 December 29th, 2003 05:24 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.