f
foxtrot".substring( 0, 1 )
What is returned by substring?
(the empty string)
foxtrot".substring( 0, 0 )
What is returned by substring?
tr
foxtrot".substring( 3, 5 )
What is returned by substring?
xtrot
foxtrot".substring( 2, 6 )
What is returned by substring?
trot
foxtrot".substring( 3 )
What is returned by substring?
foxtrot
foxtrot".substring( 0 )
What is returned by substring?
2
foxtrot".substring( 3, 5 ).length()
What is returned by length?
1
foxtrot".substring( 5, 6 ).length()
What is returned by length?
0
foxtrot".substring( 4, 4 ).length()
What is returned by length?
substring( int, int )
substring( int )
What are the two overloads of the substring method?
length()
What method is used to find the length of a string?
compareTo
What method is used to compare two strings?
less than 0
int test = "fox".compareTo( "hen" );
What is the approximate value of test?
greater than 0
int test = "hen".compareTo( "fox" );
What is the approximate value of test?
0
int test = "fox".compareTo( "fox" );
What is the approximate value of test?
greater than 0
int test = "fox".compareTo( "Hen" );
What is the approximate value of test?
less than 0
int test = "Hen".compareTo( "fox" );
What is the approximate value of test?
greater than 0
int test = "fox".compareTo( "Fox" );
What is the approximate value of test?
Unpredictable
boolean test( String str )
{ return str == "fox" ); }
If str contains "fox" what will test return?
4
tictactoe".indexOf( 'a' )
What is returned by indexOf?
8
tictactoe".indexOf( 'e' )
What is returned by indexOf?
-1
tictactoe".indexOf( 'T' )
What is returned by indexOf?
0
tictactoe".indexOf( 't' )
What is returned by indexOf?
2
tictactoe".indexOf( 'c' )
What is returned by indexOf?
f
foxtrot".substring( 0, 1 )
What is returned by substring?
(the empty string)
foxtrot".substring( 0, 0 )
What is returned by substring?
tr
foxtrot".substring( 3, 5 )
What is returned by substring?
xtrot
foxtrot".substring( 2, 6 )
What is returned by substring?
trot
foxtrot".substring( 3 )
What is returned by substring?
foxtrot
foxtrot".substring( 0 )
What is returned by substring?
2
foxtrot".substring( 3, 5 ).length()
What is returned by length?
1
foxtrot".substring( 5, 6 ).length()
What is returned by length?
0
foxtrot".substring( 4, 4 ).length()
What is returned by length?
substring( int, int )
substring( int )
What are the two overloads of the substring method?
length()
What method is used to find the length of a string?
compareTo
What method is used to compare two strings?
less than 0
int test = "fox".compareTo( "hen" );
What is the approximate value of test?
greater than 0
int test = "hen".compareTo( "fox" );
What is the approximate value of test?
0
int test = "fox".compareTo( "fox" );
What is the approximate value of test?
greater than 0
int test = "fox".compareTo( "Hen" );
What is the approximate value of test?
less than 0
int test = "Hen".compareTo( "fox" );
What is the approximate value of test?
greater than 0
int test = "fox".compareTo( "Fox" );
What is the approximate value of test?
Unpredictable
boolean test( String str )
{ return str == "fox" ); }
If str contains "fox" what will test return?
4
tictactoe".indexOf( 'a' )
What is returned by indexOf?
8
tictactoe".indexOf( 'e' )
What is returned by indexOf?
-1
tictactoe".indexOf( 'T' )
What is returned by indexOf?
0
tictactoe".indexOf( 't' )
What is returned by indexOf?
2
tictactoe".indexOf( 'c' )
What is returned by indexOf?