Skip to content

Tag Archives: Java-String-Programs

Given a date, the task is to write a Java program to convert the given date into a string. Examples: Input: date = “2020-07-27” Output:… Read More
Given a string str, the task is to print the first and the last character of the string. Examples: Input: str = “GeeksForGeeks” Output: First:… Read More
Given a string str, the task is to convert the given string to its boolean value. Boolean datatype consists of only two values: true and… Read More
Given a string in camel case, the task is to write a Java program to convert the given string from camel case to snake case… Read More
Given a string, the task is to write a Java program to check whether the string contains only alphabets or not. If so, then print… Read More
Given a string str, the task is to remove all non-alphanumeric characters from it and print the modified it. Examples:  Input: @!Geeks-for’Geeks,123 Output: GeeksforGeeks123 Explanation: at symbol(@), exclamation… Read More
Given a string str, the task is to write a Java program to check whether a string contains only digits or not. If so, then… Read More
Given a string str of some specific length, the task is to pad this string with the given character ch, inorder to make the string… Read More
Given a string str, write a Java program to print all words with even length in the given string. Examples: Input: s = "This is… Read More
Given a Float value in Java, the task is to convert this float value to string type. Examples: Input: 1.0 Output: "1.0" Input: 3.14 Output:… Read More
Given a Short value in Java, the task is to convert this short value to string type. Examples: Input: 1 Output: "1" Input: 3 Output:… Read More
Given a Double value in Java, the task is to convert this double value to string type. Examples: Input: 1.0 Output: "1.0" Input: 3.14 Output:… Read More
Given a Byte value in Java, the task is to convert this byte value to string type. Examples: Input: 1 Output: "1" Input: 3 Output:… Read More
Given a String “str” in Java, the task is to convert this string to float type. Examples: Input: str = "1.0" Output: 1.0 Input: str… Read More
Given a String “str” in Java, the task is to convert this string to short type. Examples: Input: str = "1" Output: 1 Input: str… Read More