Answers for "java find index of first alpha character in string"

0

java letter alphabet index

String str = "abcdef";
char[] ch  = str.toCharArray();
for(char c : ch){
    int temp = (int)c;
    int temp_integer = 96; //for lower case
    if(temp<=122 & temp>=97)
        System.out.print(temp-temp_integer);
}
Posted by: Guest on April-07-2020
0

java find index of first alpha character in string

String line = "000 1 This is my message";
Pattern p = Pattern.compile("\p{L}");
Matcher m = p.matcher(line);
if (m.find()) {
    System.out.println(m.start());
}
Posted by: Guest on November-29-2021

Code answers related to "java find index of first alpha character in string"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language