¡GoConqr estrena diseño! Cuéntanos qué te parece.

Módulo 8 de 9 · Multimedia

Replace Strings

Kostas Diakogiannis

Replace Strings

Replace string method

The replace function, when attached to a string can replace a part of a string, with another specified string. 

The function is simple. Accepts two arguments. The first contains the string that we want to get rid off, and the second contains the string that is going to replace it.

Take a closer look to the example above, we replace the word 'negative' which lies inside the sentence string variable, with the word 'positive'. The replaced string is stored into a new string variable. 

In the end, line 5 prints: 'I have something positive to say here'

Instrucciones

Para avanzar en el curso, envía un intento de este test. Puedes enviarlo después de la última pregunta.

Ir al módulo elegido

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?