Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

225
Visualizações
Regular Expressions in HTML

I hope you are well. So, as you can see, from "a-z" I have made a code to transcript every common letter (from "a" to "z") in some symbols. How can I do it when I want to transcript the letters "th" together in different symbol? I do not want the app to translate the letters "t" and "h" separately BUT together! How can I do that? Thank you so much!!!

var theInput = txtBr.value.toLowerCase();

for (var i = 0; i < theInput.length; i++)

 {
   
  
  var letter = theInput.charAt( i );
    
  if( letter.match(/[a-z\s]/i) ) {
    
    
    var symbol = map[ letter ];
    
    
    txtarea.innerHTML += symbol;
    
  }
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

string.search() will return the position of the substring you are searching for.

let string = "nspoiuthpiifs"; 
let position = string.search("th"); // will return 6

You could then split the string at that position with string.split(), replace the the "th" with the symbol you desire, then rejoin the string with array.join()

Note: string.search() will return only the position of the first one it finds, so you may want to repeat this method until there are none left.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda