String manipulation are quite common in programming tasks. For instance, ACSL_Search, ACSL_Lisp, ACSL_Scrabble, etc. A quite useful technique is to use split(" ") to split a long string such as a sentence into an array of smaller strings such as words. Then you can search through each word.
Common Java methods that help a lot in string manipulation:
1) split(): to split a sentence into words.
2) substring(): to cut strings into small pieces.
3) indexOf() and lastIndexOf(): to search through a string for some character
4) charAt(): give you the character at specified position of a string
5) toUpperCase() and toLowerCase(): as the names say.
6) trim(): get rid of extra white spaces
7) length(): often use with substring() to cut off part of the string
8) toCharArray(): turn "Hello" into {'H', 'e', 'l', 'l', 'o'} so you can traverse.
Short questions: #1-#5 in 2016-17c2jr.doc
Coding task: ACSL_Playingcards is for you to practice the methods/functions above
1. 5
2. /-+^2 b a *-*ab c c +bd
3.01101
4.10001
5.2
1. 1.16
2. a b+ c- a b* c - b d*+/
3. 01101
4. 10110
5. 0