Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

276
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!