“Substitua a função” Respostas de código

String substitua

string a = "String";
string b = a.Replace("i", "o"); // Strong
       b = a.Insert(0, "My ");  // My String
       b = a.Remove(0, 3);      // ing
       b = a.Substring(0, 3);   // Str
       b = a.ToUpper();         // STRING
int    i = a.Length;            // 6
PrashantUnity

Substitua a função

#replace(a,b) is the function which can replace the 'abc' word to 'klmn' word
example
a=input(' sentence :')
b=input(' word to be replaced :')
c=input(' word to be replaced with :')
d=a.replace(b,c)
print(d)
#output:
'''
sentence :richard play with pixis and natasha, rahim play along johan,rosel and ethan 
word to be replaced :play
word to be replaced with :go
richard go with pixis and natasha, rahim go along johan,rosel and ethan 
'''
Gr@Y_orphan_ViLL@in##

Substitua a função

const myText = 'The weather is cold';
const newString = myText.replace('cold', 'warm');
console.log(newString); // Should print "The weather is warm"
// the replace() string function takes a string,
// replaces one substring with another, and returns
// a new string with the replacement made
Concerned Curlew

Respostas semelhantes a “Substitua a função”

Perguntas semelhantes a “Substitua a função”

Mais respostas relacionadas para “Substitua a função” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código