Java Word Chain Questions

Asked 2 years ago, Updated 2 years ago, 28 views

In the code of making a word chain game, To get characters from a string int lastindex = word.length()-1; char lastchar = word.charAt(lastIndex); Is there any other way to receive text messages besides the format?

java

2022-09-22 19:10

1 Answers

The following methods are typical.

char lastChar = word.charAt(word.length() - 1)
String lastStr = word.substring(word.length() - 1)


2022-09-22 19:10

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.