changing string into array

Please discuss general Delphi programming topics here.

changing string into array

Postby mac1234mac » October 25th, 2008, 3:32 pm

Hello,

I have following string:

'abcd -9.456 on'

I'd like to divide this string into array of symbols so, for example, first element of my array would
be: a[0] := a, second a[1] := b etc. How can I do it in Delphi 7.0?.

Cheers.
mac1234mac
Active Member
Active Member
 
Posts: 5
Joined: July 24th, 2008, 7:17 am

Postby Kambiz » October 25th, 2008, 7:52 pm

You can index a string variable just as you would an array.

Index of the first character is 1, the second is 2, and so on.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Re: changing string into array

Postby jdraver » November 19th, 2008, 12:02 pm

maybe take a look at http://www.delphibasics.co.uk/RTL.asp?Name=Array

nice little site with basics !
jdraver
Member
Member
 
Posts: 3
Joined: November 16th, 2008, 9:37 pm


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron