separating a string
#1

Hello everyone

I have a question, I want to separate a string and get each letter you have it.

example: string = hello

I wish the function returns h e l l o

and later I could use each letter.

Thx.
Reply
#2

Well, if you think about how the string hello is made, it's easy just to get a single letter from the string.

For example, the string hello would be like this
pawn Код:
new string[5] = "hello";
/*
string[0] = 'h'
string[1] = 'e'
string[2] = 'l'
string[3] = 'l'
string[4] = 'o'
*/
Could you please give me a example of what it would be used for?
Reply
#3

Quote:
Originally Posted by [HiC]TheKiller
Посмотреть сообщение
Well, if you think about how the string hello is made, it's easy just to get a single letter from the string.

For example, the string hello would be like this
pawn Код:
new string[5] = "hello";
/*
string[0] = 'h'
string[1] = 'e'
string[2] = 'l'
string[3] = 'l'
string[4] = 'o'
*/
Could you please give me a example of what it would be used for?
I'm making a cell phone system in TextDraw, and when the player enter a number

example: 123456 to TextDraw would flash the numbers

1
2
3
4
5
6

according to the sequence that were typed.


Thx


@ EDIT -

problem solved [HiC]TheKiller helped me. Thank you very much
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)