Java Wstaw char w ciągu indeksu

public String addChar(String str, char ch, int position) {
    return str.substring(0, position) + ch + str.substring(position);
}
Distinct Dog