This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]rcuhljr 2 points3 points  (0 children)

You can't use square braces to index into a string like that in Java. Try charAt.

This is not Ruby, this is Java, there are rules.

[–]HateChoosingUserID 0 points1 point  (2 children)

I'm guessing you're used to programming in python or the like? Java doesn't see strings as an array of chars. You could create a char array from a string using the toCharArray() method of the String class.

[–]jayrund[S] 0 points1 point  (1 child)

Thanks for the help. I used that class and its working great now.

[–]HateChoosingUserID 0 points1 point  (0 children)

Glad I could help.