ccoe1
asked on
manipulation of a long string
I get a string from a recordset, with is delemitered by the | character for
the different values.
The string looks like this: Peter|Pan|Donald|Duck
Now I would like to each value seperately. For example LblFax.Text should have the value "Donald".
strDetails = rs.GetString(ADODB.StringF ormatEnum. adClipStri ng
,1,"|",",",null);
LblFax.Text = getTheDetails(0);
I wrote the getTheDetails function to get the strings.
public string getTheDetails(int intIndex)
{
int intEnd = strDetails.IndexOf("|", intIndex, strCurrent.Length);
strTmpDet = strDetails.Substring(intEn d);
return strTmpDet;
}
It doesn't work properly. Where do I set from which delemiter to begin. Or
is this not possible at all?
Thanks for your help.
Cheers
Chris
the different values.
The string looks like this: Peter|Pan|Donald|Duck
Now I would like to each value seperately. For example LblFax.Text should have the value "Donald".
strDetails = rs.GetString(ADODB.StringF
,1,"|",",",null);
LblFax.Text = getTheDetails(0);
I wrote the getTheDetails function to get the strings.
public string getTheDetails(int intIndex)
{
int intEnd = strDetails.IndexOf("|", intIndex, strCurrent.Length);
strTmpDet = strDetails.Substring(intEn
return strTmpDet;
}
It doesn't work properly. Where do I set from which delemiter to begin. Or
is this not possible at all?
Thanks for your help.
Cheers
Chris
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
string[] a_str = strDetails.Slpit("|"); to this and it works perfect
a_str = strDetails.Split('|');