how to get this two strings in same format I mean in size So that I can run the activity in “Then Block”
Use variable.trim → This will remove extra spaces in string.
Hi as @pravin_calvin suggested go with trim option
may be an extra space is counting as one character
if you want to check total characters use
variable.length
so you will understand the total count before comparing the strings
Dates should be compared with DateTime.Compare, not their string representation.
However when comparing strings I usually use the String.Equals method with .Trim and a case insensitive StringComparison. That ensures the comparison is not case sensitive and all whitespaces are removed.
String.Equals(stringA, stringB, ComparisonType)
i.e.
String.Equals(str1.Trim, str2.Trim, StringComparison.OrdinalIgnoreCase)
- Use StringComparison.Ordinal or StringComparison.OrdinalIgnoreCase for comparisons as your safe default for culture-agnostic string matching.
- See: Best practices for comparing strings in .NET
Example:
Kind Regards
got the answer thank You
Got the annser thank you
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.