Wpis z mikrobloga

@Szczypioreg: http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#substring%28int,%20int%29

public String substring(int beginIndex, int endIndex)

Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1. Thus the length of the substring is endIndex-beginIndex.


U Ciebie: beginIndex = 1, endIndex = 1. Stąd: length = 1-1 = 0. Wynik? "" czyli pusty string.
Dokumentacja nie boli.
  • Odpowiedz