java get the index of first alpha character in string

www.la‮ruttu‬i.com
java get the index of first alpha character in string
/**
 * @author lautturi.com 
 * Java example: getting the position of first letter in a string
 */

import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Lautturi {

	public static void main(String[] args) {

		String str = " 12345hello java";
		Pattern p = Pattern.compile("\\p{L}");
		Matcher m = p.matcher(str);
		if (m.find()) {
			System.out.println(m.start());
		}
	}

}

output:

6
Created Time:2017-09-23 15:32:52  Author:lautturi