Questions tagged [string-search]

String searching algorithms (also known as string matching algorithms) are an important class of string algorithms that try to find a place where one or several strings (also called patterns) are found within a larger string or text.

String searching algorithms (also known as string matching algorithms) are an important class of string algorithms that try to find a place where one or several strings (also called patterns) are found within a larger string or text.

Use this tag for programming questions related to string searching algorithms.

Source: Wikipedia

261 questions
-2
votes
1 answer

How do I make an int object into something that is subscriptable?

My specific question is if anyone can recognize why when I run this code below, I am getting this specific error. Or better yet, how to fix it. I'm trying to map a department description of a department number in df5 to a second data frame's (df2)…
Royale_w_cheese
  • 297
  • 2
  • 9
-3
votes
2 answers

Is there a fast Java library to search for a string and its position in file?

I need to search a big number of files (i.e. 600 files, 0.5 MB each) for a specific string. I'm using Java, so I'd prefer the answer to be a Java library or in the worst case a library in a different language which I could call from Java. I need the…
machinery
  • 3,793
  • 4
  • 41
  • 52
-3
votes
2 answers

I want to find the index of the string in an array

I have to search a string in an array from the user input, but I have an error in my logic. Even when the user input is in the array I still get "data not found" I also have to display the index where the string is located in the array if it's…
hooman
  • 23
  • 5
-3
votes
3 answers

Check if a word contains one or more asterisks

I have referred to some posts related to this on Stack Overflow. However I did not really find a very convincing way of doing this. How would I have a function to return True or False depending on whether a word (which is input to the function)…
asimo
  • 2,340
  • 11
  • 29
-4
votes
2 answers

Understanding how to search for string within another string

I'm trying to write for code that searches for the first occurrence of a string (a needle) within another string (a haystack) and return the index of the first character in the matching string. I've found the following solution online, but I'm…
Edward Sun
  • 183
  • 2
  • 12
-5
votes
2 answers

Looking for single digits in my string in python

I want to search my string for single digits, for every different single digit in python. If it contains 1 in want to add 1 to another list and same for other digits. //single-digit found ar.append(single-digit) example-string: ap126ks8 …
Jai dewani
  • 143
  • 1
  • 9
1 2 3
17
18