hi everyone,
i am very new in java.can anyone help me to do the following problem:
Write a program to do the following using in-built methods in the string class of java.
1) Find the 5th caracter in the string " RUSTIN BOND"
2) Find the index of character "K" in string "KANSAS".
3) Convert the string "hello world" to uppercase.
4) Replace character 'h' with 'b' in the string"humble".
Ok, the String class is a very important tool in java. Make yourself famaliar with it.
Go to this Weblink to revise some of its properties. Weblink
Your code should be simliar to this....
------------------------------------------------------------------------
public static void main(String[] args)
{
/*1) Find the 5th caracter in the string " RUSTIN BOND"
2) Find the index of character "K"in string "KANSAS".
3) Convert the string "hello world"to uppercase.
4) Replace character 'h'with 'b'in the string"humble */
System.out.println("\nCurrent String: " + no4);
System.out.println("Replace character h with b: " + no4.replace('h', 'b'));
}
-----------------------------------------------------------------
Hope that helps! Rickste_r