Generation

generate functionSun, 13 Nov 2022

find the first letter inside a string and replace it with "dogs"

void replace_dog(string &s) { char firstLetter= s[0]; s.replace(0, 1, "dogs"); }

Questions about programming?Chat with your personal AI assistant