2,261 questions
3
votes
5
answers
189
views
How to calculate percentage similarity between two comma-separated strings in Excel?
I'm trying to compare two comma-separated strings in Excel and calculate the percentage of similarity based on matching values at the same position.
For example:
Cell A2 contains: "1,E,E,E,E,E&...
1
vote
1
answer
120
views
How to match a permission to an action in an Entra role using Powershell
From time to time, I am asked where a permission is being used in Entra. For example, who has access to modify network settings and on which resources? I have a script that does a pretty good job of ...
0
votes
2
answers
63
views
How to allow a certain differences in a text assertion for a test case that has some expected changes in data using phpunit?
I am setting up a golden master test case, yet the result may be off at certain points due to side-effects changing some strings at known places.
Getting rid of those side-effects would be best, yet ...
2
votes
1
answer
258
views
Fast Delphi ASM ASCII string comparison optionally ignoring first char
I am looking to create a Delphi function that ignores the first character of either string if it starts with a Chr(127). This is used in a sort comparison which is extremely slow with 30,000 items ...
0
votes
0
answers
27
views
Comparing 2 strings of text from different rows showing the differences and what field the differences come from
I have a set of data and want to compare the differences between 2 rows but also label what column the differences appear.
Type Units Cost
Dogs. 5. £20
Dogs. 5. £25
...
-4
votes
1
answer
120
views
String compareTo() in java
Consider:
String s1 = "ABc";
String s2 = "abc";
System.out.println(s1.compareTo(s2));
On which basis the output will be -32 if only the first character decimal value of s1 and s2 ...
0
votes
0
answers
28
views
compare two blob colomn values to find percentage of similarity
how to compare two blob colomns on the same table ?
For example: PIC1 contains a picture of a bridge taken from 5 meter distance, whereas PIC2 contains a picture of the same bridge taken from 10 meter ...
0
votes
3
answers
107
views
VBA remove string custom salutation name from list table excel
I have string name with salutation
DATIN SERI PADUKA JOHN DOE with actual name is JOHN DOE
and i have list excel for salutation :
DATIN SERI
DATIN SERI PADUKA
Currently using substitute function from ...
3
votes
3
answers
179
views
Comparing alphabets but not using strcmp
I want to compare two strings with function int compare(char* A, char*B), returning 1 when A is larger, 0 when B is larger.
Assume the maximum character is 100, I want the order to be ‘A’< ‘a’ < ...
1
vote
5
answers
158
views
how to get rid of count if there is only a single character?
In my program, whenever I have a single character, it will have a count of 1. For example, if I had abbbbbc, I would get back a1b5c1. I don't want single characters to have a count. I like the program ...
-2
votes
2
answers
81
views
PL/SQL function to detect a one way character change between 2 strings
I want to write a PL/SQL function with 4 arguments: SEARCH_STRING, CHECK_STRING, SEARCH_CHAR and CHECK_CHAR
where the function will check the SEARCH_STRING against the CHECK_STRING and detect whether ...
2
votes
1
answer
57
views
Why is CompareTo() not recommended for checking equality?
I was reading about best practices for comparing strings and saw these two points:
Use the String.Compare and String.CompareTo methods to sort strings, not to check for equality.
Don't use an ...
-1
votes
1
answer
95
views
Seeking an algorithm or approach to compare values between two strings (.NET)
I have a problem with a piece of data as a string, and I have to check if the data exists between the stated ranges.
Note that if both ends are numbers, the comparison is not the usual number ...
0
votes
1
answer
64
views
Unable to understand the difference between normal comparison of strings and comparison using localCompare() method as both works differently
I am a newbie in JavaScript and programming. Need assistance to clarify this doubt
console.log('a'>'A'); // -> True
let result = 'a'.localeCompare('A');
console.log(result); // -&...
0
votes
1
answer
72
views
Option Compare Text in VB.net is *very* slow?
I only learned of Option Compare Text recently so I wrote a little test:
Dim sw As New Stopwatch()
Dim w As Boolean = False
sw.Reset()
sw.Start()
Dim A As String = "hello, world"
For o As ...
1
vote
1
answer
76
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 ...
-2
votes
1
answer
125
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);">...
-1
votes
2
answers
67
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 ...
2
votes
0
answers
239
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 ...
3
votes
1
answer
1k
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 ...
1
vote
2
answers
127
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 ...
1
vote
1
answer
120
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)...
0
votes
2
answers
114
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
...
0
votes
2
answers
137
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 ...
-1
votes
1
answer
105
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 ...
1
vote
1
answer
79
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-...
1
vote
2
answers
325
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 ...
0
votes
0
answers
72
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 ...
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 ...
1
vote
1
answer
839
views
How to properly search for wildcard characters using variables in PowerShell?
When doing string comparison, the -like comparator is my usual go-to solution.
But there is one odd thing I cant wrap my head around when using wildcards with variables.
String example
This will work.....
0
votes
3
answers
101
views
Searching for a character in a named list in R
I have a named list and want to search if a character string appears in it.
data_list <- list()
data_list$item1 <- c("hello_world"="hi", "snooker cue"="cue&...
0
votes
1
answer
83
views
Extract difference between 2 strings with ArrayFormula in Google Sheets
I have a list of initial IDs and a list of resulting IDs in Google Sheets - I'm looking to have the third "Leftover IDs" column compare the first two columns and return the difference in ...
2
votes
4
answers
668
views
Cypress - verifying presence of alias or comparing text in alias to string in 'if' statement
I'm creating an API automation suite with Cypress.
I have API tests which don't require logging in, and ones that do.
I have written a utility method called 'callAPI' which all my tests will use - it ...
2
votes
1
answer
83
views
localeCompare unable to match if the text includes single quote
I am currently working on a Photoshop Plugin which loops over all the text inside each textLayer.
I then try to match that text with data from a spreadsheet which contains the same texts. The full ...
1
vote
1
answer
123
views
Why does "some string" > 0 evaluate to TRUE in R? [duplicate]
Why does R evaluate "string" > 0 as TRUE?
I first thought this might be due to an implicit type conversion or that R interprets this as nchar("string") > 0. This does not ...
1
vote
1
answer
73
views
Comparing two different string elements of the same multidimensional array in Java
I'm currently doing a practice question for an upcoming practical exam and am stuck. I've written a method to check whether a set of three cards is valid or invalid where we're told that "Two ...
2
votes
1
answer
3k
views
What is the equivalent in JavaScript of comparing strings in .NET with ordinal ignore case?
In .NET we have the ability to compare strings using an ordinal comparison while ignoring the case. This is a best practice for string comparison especially when multiple cultures could be involved.
...
-2
votes
1
answer
797
views
Objects.equals() vs StringUtils.isNotBlank() in Java
Could you please explain me if there is a difference between the functionality of the following codes?
I know that the Objects.equals() checks for the NULL value first and then compares the two ...
3
votes
2
answers
91
views
word comparison in a line of text in c#
Hi I am using c# language in my project and I am trying to get output something like below.
string str1 = "Cat meet's a dog has";
string str2 = "Cat meet's a dog and a bird";
...
0
votes
1
answer
553
views
Python: Get substring of a string with a closest match to another string
A nice algorithmic trivia for you today. :)
I have two strings – one is a longer sentence and the another one is shorter sentence that was discovered by LLM within the longer one. Let's see an example:...
-3
votes
1
answer
125
views
Problems when comparing Strings using the "==" operator (Java 11) [duplicate]
I'm a newbie to Java. Now I'm studying "==" operator with String.
I know that in java, string literals are stored in String Pool in Heap area to achieve immutability and memory saving. And I ...
1
vote
1
answer
201
views
C++ change priority queue to alphabetical order?
I am trying to create a priority queue of pairs, with book names (strings) and lengths (int).
I'd like the priority queue to have the earliest title at the top.
By default the priority queue is ...
1
vote
2
answers
1k
views
SQL Server Collation Setting
In the SQL server, the default collation is SQL_Latin1_General_CP1_CI_AS, previously, I used to specify the collation explicitly at the end of each query to SQL_Latin1_General_CP1_CI_AI to ignore the ...
4
votes
1
answer
420
views
An algorithm to fix a subtitle.srt file with ground truth paragraph
I have a subtitle.srt file, but its content is not as accurate as it should be. In parallel, I also have a set of paragraphs that is accurate but not in time synchronized.
The inaccuracy can be caused ...
1
vote
1
answer
65
views
Assembly 16bit real mode - CMPS return always 0
I want to make a small operating system in 16 bit assembly.
In this code I'm creating a sort of 'terminal' where I take the user input and if the input is shutdown then start the function to shut ...
2
votes
5
answers
2k
views
Python: How to sort a list of custom objects by multiple attributes by different order?
For example, if I have a Person class
class Person:
def __init__(self, name: str, age: int):
self.name = name
self.age = age
def __repr__(self) -> str:
return f&...
1
vote
1
answer
50
views
How to check if one wildcard expression (AKA glob) contains another wildcard expression?
I have two wildcard expressions g1 and g2, and I would like to know whether g1 contains g2.
For example:
g1 = "*.txt"
g2 = "hello*.txt"
In this case g1 contains g2.
1
vote
0
answers
2k
views
How golang applies less than and greater than operators to strings?
I'm wondering if only the length of the strings is being compared, or the lexical order is also considered.
If anyone knows where it can be viewed in the code - I would be grateful for the link!
1
vote
2
answers
93
views
Read strings out of a file and parse /0 character and utf8 signs right in c
I want to write a Hangman game which randomly chooses a word from a list in a text file.
The implementation works if i set a word per initialization:
char wort[] = "Apfelbäumchen";
If I ...
1
vote
1
answer
85
views
Compare values in one column with another column
A2 has cotton,leather
B2 has Leather,wool,cotton
I need to see if all values in A2 is present in B2 irrespective of case or order or any extra values in B2.
So i need a formula which says present in ...