Tags » Substring

Knuth-Morris-Pratt substring search

When searching for the pattern A A B A A A in the text A A B A A B A A A A, we first detect the mismatch at position 5, but we had better restart at position 3 to continue the search, since otherwise we would miss the match. 250 more words

Brute Force Pattern Matching, Delete Pattern Replace Pattern

Pattern matching is the problem of deciding whether or not a given string pattern P appears in a string text T. First pattern matching algorithm is brute force. 380 more words

Rabin-Karp Text search Algorithm

We compute a hash function for the given M character pattern and then look the same hash function value for each M-character sub string of the text. 312 more words

Reversing words in a sentence without using PHP functions

Hi guys,

I need to know how to reverse a words in a sentence without using any inbuilt string manipulation functions(like explode, split, substring, array_reverse, etc) in PHP. 46 more words


Bonfire 09: Confirm the Ending

TASK: Check if a string (first argument) ends with the given target string (second argument).

var index = str.length-target.length;

if (str.substr(index)===target) {
return true;

else return false;


How to Format a Date in Command Prompt (CMD) to YYYYMMDD

For those that don’t like reading tutorials, and prefer watching how it is done whilst following along, I have attached my YouTube video of the same tutorial. 324 more words


Mysql Substring approches

SUBSTR and SUBSTRING are synonyms, therefore can be used interchangeably.
Indexing starts with 1 (not 0)
(The result of each query is in the comment starting with #) 24 more words