java insert char in string at index

118

java insert char in string at index -

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

Comments

Submit
0 Comments