Hi I was just using stringbuilder to obtain certain part of the string using substring(int start, int end).. but I\'m having this error
08-17 20:27:40.737: E
Are you using the substring() method but you no has length lower than 4 ,so if you want to get only four number use the following code.
Ex:
class SubString
{
public static void main(String[] args)
{
StringBuilder str = new StringBuilder(phoneNumber);
if(str.length()>4){
System.out.println(str.substring(0,4));
}
}
}