code in java Replace the character in the string at the n index with a '*' ifthe
Fantastic news! We've Found the answer you've been seeking!
Question:
code in java
Replace the character in the string at the n index with a '*' ifthe string is long enough to have a character at the n index. Ifthe string does not have enough characters, leave the Stringas-is.
replaceCharAtIndex("A String", 0) ? "* String"
replaceCharAtIndex("*****", 3) ? "*****"
replaceCharAtIndex("A String", 1) ? "A*String"
public String replaceCharAtIndex(String s, int n) {
}
Posted Date: