0

Good evening,

How do I need to put string into array characted by character? For example:

I have a string "WELCOME".

Then I can call command coolarray [ 3 ] and I got a letter L ?

Thanks!

3
Contributors
8
Replies
11
Views
5 Years
Discussion Span
Last Post by NormR1
0

What kind of an array? The String class has a method that will create an array from a String.
Or create the array and use another String class method to get the characters one by one and store them into the array.

BTW array indexes start at 0. L's index would be 2, W 's is 0

Edited by NormR1

0

I guess int array won't work here? So my answer would be that I will use String array. And yes I made a mistake by saying that third member would be 'L'.

0

You would use one of the String class's methods to get the characters of the String one by one in a loop and store them into the array.

Edited by NormR1

0

You would use one of the String class's methods to get the characters of the String one by one in a loop and store them into the array.

I asking you directly... how to do it? I just don't have enough programing skills to make it by myself..

0

What code do you have so far? Where are you having problems?
Which methods of the String class are you having problems witlh?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.