Type on character at a time into a input field

If we want to type on character at a time into a input field instead of the entire string we use this

for(int i =0;i<name.length();i++){
char c = name.charAt(i);
driver.findElement(By.xpath(xpath)).sendKeys(String.valueOf(c));
}