public static class StringSearch.SimpleStringSearch extends StringSearch
Implement a simple string search algorithm using JDK String.indexOf
algorithm
StringSearch.SimpleStringSearch
Constructor and Description |
---|
StringSearch.SimpleStringSearch() |
Modifier and Type | Method and Description |
---|---|
int |
search(char[] text,
char[] target,
int from)
Search a char array in another char array with from index specified
|
apply, wrap
public int search(char[] text, char[] target, int from)
StringSearch
Search a char array in another char array with from index specified
search
in class StringSearch
text
- the char array to be searchedtarget
- the pattern to be searched across the textfrom
- the from index it shall be non-negative number. If from index is negative number then it starts from 0
; if from
is greater than or equals to the text length then -1
will be returned-1
is returnedCopyright © 2014–2018 OSGL (Open Source General Library). All rights reserved.