substring的用法

"unhappy".substring(2) returns "happy"

"Harbison".substring(3) returns "bison"

"emptiness".substring(9) returns "" (an empty string)

subString("java.util.List".lastIndexOf(".")+1) returns "List"

"中国人".substring(0, "中国人".lastIndexOf("人")) returns "中国"

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.