O GoConqr está de visual novo! Conte para nós o que você achou.

Módulo 8 de 9 · Mídia

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'

Instruções

Para avançar no curso, envie uma tentativa deste quiz. Você pode enviá-la depois da última pergunta.

Ir para o módulo escolhido

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?