0% found this document useful (0 votes)
24 views5 pages

Java String Manipulation Examples

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views5 pages

Java String Manipulation Examples

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Convert String to Uppercase

Write a Java program that takes a string input from the user and converts it to uppercase using
the toUpperCase() method.

Example:

Input: "java programming"


Output: "JAVA PROGRAMMING"

Write a Java program that asks the user to input a string and prints the length of the string using
the length() method.

Write a Java program that takes a string and an index as input and prints the character at that
specific index using the charAt() method.

Write a Java program that takes a string as input and prints the last character using the
charAt() and length() methods.

Write a java program to print an average of three numbers.

Write a program to print the remainder of 13 divided by 5.


Convert String to Uppercase
Write a Java program that takes a string input from the user and converts it to uppercase using
the toUpperCase() method.

Example:

Input: "java programming"


Output: "JAVA PROGRAMMING"

Write a Java program that asks the user to input a string and prints the length of the string using
the length() method.
Write a Java program that takes a string and an index as input and prints the character at that
specific index using the charAt() method.

Write a Java program that takes a string as input and prints the last character using the
charAt() and length() methods.
Write a java program to print an average of three numbers.
Write a program to print the remainder of 13 divided by 5.

You might also like