class StringUtilities {

	public static int findLastWordPosition(String s) {
		int len = s.length();
		int pos = -1;
		for (int i = len - 1; i >= 0; --i) {
			char c = s.charAt(i);
			if (!Character.isLetterOrDigit(c)) {
				pos = i + 1;
				break;
			}
		}
		// did string end of a char that is not a letter or digit?
		if (pos >= len) {
			pos = -1;
		}
		return pos;
	}

	private  StringUtilities();

}