JAVA中怎样输入字符串

https://zhidao.baidu.com/question/344967589.html

java.lang.String.charAt() 方法返回指定索引处的char值。http://www.yiibai.com/javalang/string_charat.html

(toLowerCase)toUpperCase的意思是将所有的英文字符转换为大写字母,如:

String  cc = “aBc123”.toUpperCase();结果就是:ABC123。

str=str.substring(int beginIndex);截取掉str从首字母起长度为beginIndex的字符串,将剩余字符串赋值给str;

str=str.substring(int beginIndex,int endIndex);截取str中从beginIndex开始至endIndex结束时的字符串,并将其赋值给str;这是一个很常见的函数,他的所用

 

trim()是去掉字符序列左边和右边的空格,如字符串

str = " ai lafu yo ";

str = trim(str);

输出的将是"ai lafu yo"

 

parseInt(String s,int radix)就是求“int radix”进制数“String s”的十进制数是多少。

posted @ 2017-03-12 14:12  code666  阅读(4914)  评论(0编辑  收藏  举报