首页 > 其他 > 详细

String

时间:2014-10-09 22:23:42      阅读:347      评论:0      收藏:0      [点我收藏+]

1, .intern() method, return String

call .intern() method, will try to add current string into the pool, if the pool already has the string, the method will return the ref to the existing string; otherwise, it will add the string into the pool.

2, Reverse a String

new StringBuilder(str).reverse().toString();

3, change case

.toLowerCase(), .toUpperCase()

4, Compare

.equalsIgnoreCase(String anotherStr) return boolean.

.compareTo(String anotherStr) return int 0 or negative or positive.

.compareToIgnoreCase(String anotherStr).

5, to chars

.toCharArray() return char[]

.charAt(int index) return char

 

String

原文:http://www.cnblogs.com/chayu3/p/4014590.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!