public String[] split(String regex, int limit) split函数是用于使用特定的切割符(regex)来分隔字符串成一个字符串数组,这里我就不讨论第二个参数(可选)的含义详见官方API说明 我在做项目期间曾经遇到一个“bug”,就是当split函数处理空字符串时,返回数组的数组竟然有值...查完API才发现就是这么规定的. 官方API 写道 If the expression does not match any part of the input th
原文:http://java-performance.info/changes-to-string-java-1-7-0_06/ 作者:Mikhail Vorontsov IMPORTANT: Java 7 update 17 still has no changes in the subject of this article. 一直到jdk7u17,本文所说的仍然适用. Sharing an underlying char[] 共用底层的char[] An original String i
String类定义实现了java.io.Serializable, Comparable<String>, CharSequence 三个接口:并且为final修饰. public final class String defined String由char[]数组实现 /** The value is used for character storage. */ private final char value[]; /** Cache the hash code for the strin