Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [indexof]

indexof is a method in programming languages like Java, C#, JavaScript, etc. that returns the first occurrence of a letter in a string, or the first occurrence of an element in a list.

0 votes
3 answers
59 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 ...
Marshall's user avatar
0 votes
1 answer
46 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, ...
Axel Carré's user avatar
0 votes
0 answers
29 views

Wamp Server display full path of Index of

I wish to be able to see the full path of Index of / currently am getting Short Version and would like to see the full path i.e Forbidden You don't have permission What do I need to change to get full ...
dwk's user avatar
  • 1
0 votes
4 answers
65 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: "...
Sergey Cage's user avatar
0 votes
0 answers
26 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 ...
Jukebox Jory's user avatar
2 votes
3 answers
105 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 ...
Shubham kapoor's user avatar
1 vote
3 answers
40 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 ...
Josh Drucker's user avatar
0 votes
1 answer
80 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 ...
Beko's user avatar
  • 1
-1 votes
1 answer
31 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 ...
Daniel Lip's user avatar
  • 11.2k
0 votes
1 answer
51 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) // ...
code đờ's user avatar
0 votes
0 answers
23 views

Locating the positions of an array within another array [duplicate]

I am looking for all positions of an array within another array. In the examples on the next page, values are strings but I need to work with arrays: Array.IndexOf Method Here are my examples: Array....
Josep's user avatar
  • 33
0 votes
1 answer
57 views

Cannot get indexOf() from array

I'm new to Java and I'm trying to do this project for my class however I've been stuck for the last hour on one single part. I'm trying to call the index of the variables under the "fromCity"...
beansies's user avatar
1 vote
1 answer
42 views

Add to string at specific index at for each occurence

I am trying to add to a string, in this instance I am wanting to alter the href and add a string to the beginning of each href in a string. I have figured out how to do it for one instance, but not if ...
Cookies's user avatar
  • 65
-1 votes
3 answers
167 views

How to convert the perl index script to bash function

I want to use perl to get the index of from any given string and substring in bash function. Here is the example for getting the indexOf value from perl script: https://www.geeksforgeeks.org/perl-...
stackbiz's user avatar
  • 1,342
0 votes
1 answer
54 views

QByteArray::indexof always returning 1

QByteArray bItem; QByteArray alpha("0123456789ABCDEF"); quint8 iItemHi=0, iItemLo=0, index; QTableWidgetItem *hexItem = new QTableWidgetItem; hexItem = ui->hexSectorDisplay->item(x,y);...
atari8warez's user avatar

15 30 50 per page
1
2 3 4 5
133