你不catch异常,让它显示出来就知道了

解决方案 »

  1.   

    晕,,我写一个组件,不好测试,,
    如果真没人知道,,我只好写一个Application测试了..
      

  2.   

    不测试 看doc也能知道  Returns a new string that is a substring of this string. The substring begins with the character at the specified index and extends to the end of this string. 
    Examples:  "unhappy".substring(2) returns "happy"
     "Harbison".substring(3) returns "bison"
     "emptiness".substring(9) returns "" (an empty string)
     Parameters:
    beginIndex - the beginning index, inclusive. 
    Returns:
    the specified substring. 
    Throws: 
    IndexOutOfBoundsException - if beginIndex is negative or larger than the length of this String object.