Skip to main content

Questions tagged [string-comparison]

string-comparison is the action of comparing strings, resulting in a boolean or an integer indicating the "distance" between the strings.

1 vote
1 answer
54 views

How to map table references in a JSON file to corresponding values in an Excel file using Python?

I have an Excel file containing a list of requirements in 1 column and a JSON file that stores table values. The requirements in the Excel file include references to tables in the JSON file, formatted ...
Rifat's user avatar
  • 13
-2 votes
1 answer
69 views

Compare two strings containing html tags with same attributes but different orders using C#

I'd like to compare between two strings having html tags in different orders. Example: string str1="""<p><strong style="font-size: 36px; color: rgb(153, 51, 255);">...
enas mohamed's user avatar
-1 votes
2 answers
30 views

How to figure out what string was inserted somewhere into a known other string?

I’m looking for the most straighforward way to figure out which string was inserted somewhere into a known other string. Here’s what I have to work with: I have an existing variable representing a ...
Ashley Bischoff's user avatar
2 votes
0 answers
76 views

How to fold/normalize ligature characters in C# for string comparisons

I am exploring some of the more esoteric aspects of string comparisons at the moment (I went down a bit of a rabbit hole and there doesn't seem to be an end in sight!). I'd like to know how to compare ...
Dave R.'s user avatar
  • 7,264
2 votes
2 answers
198 views

How do I compare two UTF-8 strings ignoring case in Zig language?

I have two strings. Assume the following: const a = "Zig"; const b = "zig"; I want the comparison to be case - insensitive and characters will be any UTF-8 character. When I run ...
B Shyam Sundar's user avatar
1 vote
2 answers
52 views

No difference between CurrentCulture and CurrentCultureIgnoreCase, why?

I am trying to sort a sequence of letters using the Order LINQ operator, and I am not getting the expected result. I was expecting that passing the StringComparer.CurrentCulture would produce a ...
Theodor Zoulias's user avatar
0 votes
0 answers
15 views

compare numbers in range again another number

I have not programed with delphi in MANY year. In fact I am using Delphi 2010. Anyway, I have tried to find an answer online but just can't seem to find an answer. Basically I have two values 1.)...
Brenda Spinner's user avatar
1 vote
1 answer
74 views

Kotlin: how to check in functional style that char difference of two same length strings is exactly one char?

I have drafted a function in Kotlin that works good enough for me. fun diff(l: String, r: String): Int { var diff = 0 for (i in 0 until l.length) { if (l[i] != r[i]) diff++ if (diff > 1)...
Alexander Ites's user avatar
0 votes
2 answers
91 views

Why my string comparison isn't working in bash?

I've a script that does something like this: set -x myJson="echo '{\"data\":\"true\"}'" commandOutput=$(eval $myJson | jq '.data') echo $commandOutput while : do ...
Matheus's user avatar
  • 337
0 votes
2 answers
114 views

In C#, how to compare 2 strings, 1 of string had '*' / wildcard

How to compare two strings, one of which contains wildcard symbols? Like this: string string1 = "/api/mymember/get"; # * is any text string string2 = "/api/*/get"; I'd like a way ...
user23655351's user avatar
-1 votes
1 answer
100 views

string.Equals evaluates to false

I have two strings: lp.Name A string returned from a backend server database contained in the class LocalPlayer: public class LocalPlayer { public string Name; } playerName A local string ...
Flashheart's user avatar
1 vote
1 answer
47 views

Filter out values that are equal on the same row?

I've just run Get-DbaDbQueryStoreOption -SqlInstance <MySQLServer> | Where ActualState -ne DesiredState | Select Database, ActualState, DesiredState My intention was to get all rows from Get-...
J. Mini's user avatar
  • 1,778
1 vote
2 answers
195 views

How to compare l and ł (Polish character) in c# to return true

I am trying to compare the following two characters l and ł and get c# to return true i.e. I have the word Przesyłka and would like to do a string comparison to Przesylka I have tried the following ...
JKennedy's user avatar
  • 18.6k
0 votes
0 answers
51 views

Comparing 2 text files while actively looking for changes

I need my program to compare a main file with a reference file which is just a copy of the original one. The program actively looks for changes to the main file by comparing it to the comparison file ...
Tudor Oprea's user avatar
0 votes
0 answers
44 views

String comparison gives strange results [duplicate]

Why after concatination result changed? b = "test"+str(1) a = "test"+str(1) print(a is b) # False b2 = "test"+"1" a2 = "test"+"1" print(a2 ...
Vivyen's user avatar
  • 77

15 30 50 per page
1
2 3 4 5
151