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

277
Visualizações
Compare text and highlight differences in react-native

Today i want to create a app in react-native that compare two string for first time it will be simple . For example

var str1 = "Hello there";
var str2 = "Hello";

I want to highlight a word that is different from the other text. And in example it is there. Something like online compare tools. So it will looks like enter image description here

"There" word is with different background !

So i have no idea how to start. I tried with this code

const CustomText = (props) => {
    const text1 = props.str1.split(' ');
    const text2 = props.str2.split(' ');
    return <Text>{text1.map(text => {
      if (!text.includes(// here i should compare with other text)) {
        return <Text style={{ color: 'blue' }}>{text} </Text>;
      }
      return `${text} `;
    })}</Text>;
}

I dont knwo how to map this two string to compare each other . Thanks for helping ...

about 4 years ago · Juan Pablo Isaza
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