Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with incrementing strings
Message
De
05/03/2005 11:26:59
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00991021
Message ID:
00993019
Vues:
19
Glad you got it to work, Gerard.

Looks like Cetin gave you a pretty detailed answer in your other thread about the difference between string and char.

~~Bonnie


>Hi Bonnie. Tanks for your reply.
>
>I eventually got it to work with a combinbation of (char) and Char.Parse lines. I am still unclear as to the difference beween stings and Characters but i'll leave that for another thread.
>
>Regards.
>
>Gerard
>
>>Gerard,
>>
>>I think if you throw one more thing into the mix, you'd get it to work. String has a .ToCharArray() method. Once you get your string into a char array, I think you'll have an easier time incrementing it.
>>
>>~~Bonnie
>>
>>
>>
>>>Hi.
>>>I am trying to increment a string and am having problems, mostly to do
>>> with the synstax of Int and Char functions.
>>>
>>>I have a sring with two letters in it e.g. 'CF'
>>>I want to 'Increment' the string by 1
>>>e.g. Old string New string
>>> CF CG
>>> CZ DA etc
>>>
>>>IN VFP I would do the following:
>>>
>>>IF SUBSTR(MyString,2,1) = "Z"
>>> MyString = CHR(ASC(SUBSTR(MyString,1,1)) + 1) + "A"
>>>ELSE
>>> MyString = SUBSTR(MyString,1,1) + CHR(ASC(SUBSTR(MyString,2,1)) + 1)
>>>ENDIF
>>>
>>>Any ideas on how to do this in .Net
>>>(I've use a combinarion of Int and Char and Substr but am getting syntax errors)
>>>
>>>regards,
>>>
>>>Gerard
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform