M
Mike
Hi
The following program misses the last result.
May I ask why?
public class SubString
{
public static void main(String[] args)
{
String s1 = "Hello Java!!!";
System.out.println("s1 = " + s1);
char c1 = s1.charAt(0);
System.out.println("s1.toChar(7) = " + c1);
char a1[] = s1.toCharArray();
System.out.println("s1.toCharArray( ) = " + new String(a1));
char a2[] = new char[5];
s1.getChars(7, 11, a2, 0);
System.out.println("s1.getChars(7, 11, a2, 0) = " + new String(a2));
String s2 = s1.substring(7, 11);
System.out.println("s1.substring(7, 11 ) = " + s2); // No results
here...
}
}
Thank you in advance.
Mike
The following program misses the last result.
May I ask why?
public class SubString
{
public static void main(String[] args)
{
String s1 = "Hello Java!!!";
System.out.println("s1 = " + s1);
char c1 = s1.charAt(0);
System.out.println("s1.toChar(7) = " + c1);
char a1[] = s1.toCharArray();
System.out.println("s1.toCharArray( ) = " + new String(a1));
char a2[] = new char[5];
s1.getChars(7, 11, a2, 0);
System.out.println("s1.getChars(7, 11, a2, 0) = " + new String(a2));
String s2 = s1.substring(7, 11);
System.out.println("s1.substring(7, 11 ) = " + s2); // No results
here...
}
}
Thank you in advance.
Mike