1,988 questions
-5
votes
1
answer
89
views
javascrip indexOf not working with underscore= [closed]
As far as I understand, the indexOf method uses strict equality which in my mind means that if I have an object
animal = {id: 1, name: 'bison'}
the statement
animal.name === 'bison'
would be true ...
0
votes
0
answers
123
views
SubString and IndexOf giving a puzzling result
This is the code to meant to pull the value from in front of a variable (in this case the variable is Net Total )
vIndexStart = vOutput.IndexOf(vNet) + vNet.Length
If vIndexStart < 0 Then
...
0
votes
1
answer
114
views
How to get string positions And Length by multi-split filter
I am trying to create what I expect from the subroutine (GetAllPosition).
I don't know where to use RsultOfPostionAndLength in the code to get the expected output
My expectation of the output for (...
4
votes
0
answers
116
views
Bug in IndexOf with InvariantCultureIgnoreCase in .NET 5 and above?
I found a weird issue with .NET 5 and above with the IndexOf method.
I have two strings that are equals with InvariantCultureIgnoreCase:
string.Equals("est", "est", System....
0
votes
0
answers
66
views
Why is indexOfFirst() by reference equality slower than indexOf() by classes wrapping the value?
I found collections of items overriding equals() working slowly on indexOf() than ones not by almost 10 times.
my code measured it:
fun main() {
val list1 = List(65536, Int::toString)
val ...
4
votes
6
answers
117
views
How do I search for the index of an int[2] in a list?
So, I'm poking around at being able to search for the index of an int[2] in a list but I haven't had much luck.
Below is the code I've been playing with:
var coordinates = new List<int[]>();
...
0
votes
2
answers
73
views
Is string.indexOf() treated the same on Linux vs Windows?
I'm not an experienced JavaScript programmer. This is my first project using JS.
I'm developing on Linux and am at the point for my first release. Running the project on a Windows machine I came ...
0
votes
1
answer
56
views
NodeJS String.indexOf slowness even though index 200/1000000
Consider a long stringified JSON object (millions of characters) returned by an API.
Since I just need to find some value based on its key, my first reflex was to parse it and then select it directly, ...
0
votes
4
answers
74
views
How to get an index of random property of array of objects?
I have an array of objects.
const items = [{
name: "item1",
img: "img/pic/picture1.png"
},
name: "item2",
img: "img/pic/picture2.png"
},
name: "...
0
votes
0
answers
27
views
GAS Can I search down instead of across an array using indexOf() [duplicate]
I have a table in a sheet which acts like a database. A4 holds some maths to tally up the number of entries in the table. It takes ages searching through it using nested for loops, so I wondered if I ...
2
votes
3
answers
139
views
Find index of next word after the given word
I am trying to write a Java function with the following parameters:
String str: the sample text
String word: a word
String nextWord: another word
If I pass a given str, a word, and nextWord ...
1
vote
3
answers
52
views
How do you append to an object array by searching a different array for a object and returning a different object in javascript?
Similar to a vlookup in excel. I have 2 object arrays in javascript. I want to look up an object from array #1 in array #2 and push an object from array #2 to the array #1. I want this to happen for ...
0
votes
1
answer
133
views
How to find the index of words in array with specific letter?
I have a string list where i add my Tags.
A Tag cotains a Line, Source and Target.
Tag example: L02_FTxx10_STxx5
L02 -> Line
FTxx10 -> Source
STxx5 -> Target
I split every tag into an array ...
-1
votes
1
answer
40
views
How to parse exclude "alt=\ when parsing text from a string?
example of the string: alt="hello world" >"
i want to get only the hello world using indexof and substring.
int indexDescription = line.IndexOf("alt=");
int ...
0
votes
1
answer
65
views
Javascript indexOf/charAt not working for Japanese half-width Katakana
In my codebase I have this code, surprisingly it returns 1:
'トゲ'.indexOf('ケ') // Returns 1
The character ケ doesn't seem to appear in string トゲ.
I also tried to run this code:
'トゲ'.charAt(1) // ...