| Código | Saída |
|---|---|
\' | citação única |
\" | citação dupla |
\\ | barra invertida |
\n | nova linha |
\r | retorno de carro |
\t | aba |
\b | backspace |
\f | feed de formulário |
myStr usando seqüências de escape. Primeira linhaVocê precisará usar seqüências de escape para inserir caracteres especiais corretamente. Você também precisará seguir o espaçamento como aparece acima, sem espaços entre seqüências de escape ou palavras. Aqui está o texto com as seqüências de escape escritas.
\Segunda linha
ThirdLine
FirstLinenewlinetabbackslashSecondLinenewlineThirdLine
myStr não deve conter espaços
testString: 'assert(!/ /.test(myStr), "myStr should not contain any spaces");'
- text: 'myStr deve conter as strings FirstLine , SecondLine e ThirdLine (lembre-se de ThirdLine maiúsculas e minúsculas)'
testString: 'assert(/FirstLine/.test(myStr) && /SecondLine/.test(myStr) && /ThirdLine/.test(myStr), "myStr should contain the strings FirstLine, SecondLine and ThirdLine (remember case sensitivity)");'
- text: FirstLine deve ser seguido pelo caractere de nova linha \n
testString: 'assert(/FirstLine\n/.test(myStr), "FirstLine should be followed by the newline character \n");'
- text: myStr deve conter um caractere de tabulação \t que segue um caractere de nova linha
testString: 'assert(/\n\t/.test(myStr), "myStr should contain a tab character \t which follows a newline character");'
- text: SecondLine deve ser precedido pelo caractere de barra invertida \\
testString: 'assert(/\SecondLine/.test(myStr), "SecondLine should be preceded by the backslash character \\");'
- text: Deve haver um caractere de nova linha entre o SecondLine e o ThirdLine
testString: 'assert(/SecondLine\nThirdLine/.test(myStr), "There should be a newline character between SecondLine and ThirdLine");'
```