Hi everything, 
Can anyone help me on this
Str1 = "system.exception unable to find a click sleelector.
Type into click aqaes test knfkajfkaguwbdiwndkdb 
Wnajjskdjfjdjdjjwwhn wiwnd exception edjf fmjsnhjwnwh"
Str2 ="System.exception unable to find a click sleelector.
Type into click aqaes test knfkajfkaguwbdiwndkdb 
Wnajjskdjfjdjdjjwwhn wiwnd exception edjf fmjsnhjwnwh"
When Iām using if condition like
Str1.trim().contains(str2).trim()
Above 2 string as same letters space everything but still it is falling in false.
             
            
               
               
               
            
            
           
          
            
              
                rikulsilva  
                (Henrique Lima da Silva)
               
              
                  
                    December 3, 2023, 10:44pm
                   
                   
              2 
               
             
            
              
Hi @Arya_Squares 
You can use this site to compare text
Text Compare! - Find differences between two text files (text-compare.com) 
in your case, contains method is case sentitive You can check using this:
Str1.ToLower().Trim().contains(Str1.ToLower().Trim())
 
it will convert the strings to lowercase before compare
             
            
               
               
               
            
            
           
          
            
              
                Yoichi  
                (Yoichi)
               
              
                  
                    December 3, 2023, 11:42pm
                   
                   
              3 
               
             
            
              Hi,
There might be difference regarding white space. 
Can you try the following expression?
System.Text.RegularExpressions.Regex.Replace(str1,"\s+"," ").Contains(System.Text.RegularExpressions.Regex.Replace(str2,"\s+"," "))
 
Regards,
             
            
               
               
              1 Like 
            
            
           
          
            
            
              It seems the issue might be with white spaces. Try this expression for a more robust check: 
System.Text.RegularExpressions.Regex.Replace(Str1, @ā\s+ā, " ā).Contains(System.Text.RegularExpressions.Regex.Replace(Str2, @ā\s+", " "))
             
            
               
               
               
            
            
           
          
            
              
                system  
                (system)
                  Closed 
               
              
                  
                    December 8, 2023,  6:22am
                   
                   
              5 
               
             
            
              This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.