you could use the substring method of the String class.
String s1 = "I am from UK.";
String s2 = s1.substring(0, 9);
System.out.println(s2);
As i learned from CaptainMorgan, the first argument of the substring method operates on a 0 based index, meaning that the index first character of the string is 0. and then, for the second argument (9) operates on a 1 based index, meaning that the index of the first character is 1.