Questions With Solutions - String Level 2
Questions With Solutions - String Level 2
import java.util.*;
return String.valueOf(charArray);
}
}
output:
Enter a String:
RIP
After Permutation is:
RIP
RPI
IRP
IPR
PIR
PRI
Problem 3:
Write a java programming to find the longest palindromic substring of a given
string.Maximum length of the given string is 1000.
import java.util.*;
import java.util.*;
}
}
output:
tut
ttu
True
legoog
False
Problem 5:
Write a program in java to split string by space into words.
import java.util.*;
import java.util.*;
// Driver Code
public static void main(String[] args) {
try (// Given string
Scanner sc = new Scanner(System.in)) {
System.out.println("Enter the string: ");
String s = sc.nextLine();
checkHex(s);
}
}
}
output:
BF57C
Yes
Enter the string:
58GK
No
Problem 7:
Write a program in java to find the largest and smallest word in a string.
import java.util.*;
}
}
output: