Package Torello.Java
Class StrTokIndexOf
- java.lang.Object
-
- Torello.Java.StrTokIndexOf
-
public class StrTokIndexOf extends java.lang.Object
Automatic Code-Generator:
The code in this class was automatically built using a code-generator. The source-code for this generator may be viewed in the link below. It is somewhat simplistic, in that JavaString'sandStringBuilder'sare used. It did get the job done.
TokIndexOfCodeGen.java
This code was developed over two years ago (2020), and has not changed much.The purpose of this class is to help find the location ofToken-Matchesinside of an input source-String.StrTokIndexOf =>
StrTok:Token-Matchesare substring matches which are found inside a supplied'srcStr'. These matches must be both fully contained within'srcStr', and have "match locations" (String-index position in'srcStr'where the token matches) that are bounded / 'surrounded' by either white-space (space-character'#32', '\n', '\r', etc) or by characters that pass a user suppliedCharacter-Predicate test().
IndexOf:Each of the methods in this class shall return an integer, orint[] arrayof indices into the inputString 'srcStr'where match-locations were found.
Normally, checking for an occurrence of a substring inside of a JavaStringis as easy as calling the methodString.contains(substring). Problems can crop up, however, when working withString'swhose contents have derived from HTML-Attributes.
For instance, when working with the HTML Element Attribute'CLASS=...', simply making a call toString.contains(cssClassName)to find if it is a member of'cssClassName'would return many incorrect results due to the fact that thecssClassName- if occurring within the list of CSS Classes - is only considered a match if that class-name is bounded on both sides by white-space or the start (or end) of the CSS'CLASS'Attribute-Value. ThisStrTokIndexOfis nearly identical to the class with the similarly chosen nameStrIndexOf; but differs in that the matches it finds are only considered matches when the sub-string the logic is searching is found, by itself, like a separate word in theStringbeing searched.
The following examples will hopefully make more clear what aToken-Matchactually is:
Example:
int pos = StrTokIndexOf.first("This is a warm, sunny afternoon in August.", "war"); // 'pos' would evaluate to -1, because 'war' was not found as a token. HOWEVER... int pos = StrIndexOf.first("This is a warm, sunny afternoon in August.", "war"); // 'pos' would evaluate to 10, because the word 'warm' begins with 'war' and the // first letter of 'warm' is located at string-index 10. TagNode tn = new TagNode("<DIV CLASS='PersonalPics' ID='Photos-10'>"); String cssClass = "Pics"; boolean found = StrTokIndexOf.first(tn.AV("class"), cssClass) != -1; // 'found' would evaluate to FALSE, because though 'PersonalPics' contains the substring // 'Pics', it is not an actually CSS Class String match. The concept of "Token-Match" is // identical to how CSS Parsers look for Class String's // NOTE: boolean found = StrIndexOf.first(tn.AV("class"), cssClass) != -1; // 'found' would evaluate to TRUE, because 'Pics' is a substring of 'PersonalPics' // but this would be a mistake since, as a CSS class, this token is not really one of the // CSS Classes contained by the HTML divider element.
Methods Available
Method Explanation first (...) This will retrieve an integer-pointer that points to the first String-Tokenmatch found within the inputString-parameter'srcStr'.nth (...) This will retrieve an integer-pointer that points to the nth String-Tokenmatch found within the inputString-parameter'srcStr'.last (...) This will retrieve an integer-pointer that points to the last String-Tokenmatch found within the inputString-parameter'srcStr'.nthFromEnd (...) This will retrieve an integer-pointer that points to the nth-from-last String-Tokenmatch found within the inputString-parameter'srcStr'.all (...) This will retrieve an integer-pointer to every String-Tokenmatch found within the inputString-parameter'srcStr'.Method Parameters
Parameter Explanation String srcStrThis parameter is mandatory for every method here. It is the source Stringthat is being searched. Every method is designed to iterate through the characters in thisString, searching for matches ofStringorcharparameter'token'.int nthThis represents the 'nth'match of a comparisonfor-loop. When the method-signature used includes the parameter'nth', the firstn-1matches that are found - will be skipped, and the'nth'match is, instead, returned.
EXCEPTIONS: AnNExceptionshall throw if the value of parameter'nth'is zero, negative, or larger than the size of the input html-Vector.int sPos, int ePosWhen these parameters are present, only substring'sthat are found between these specifiedStringindices will be considered when returning results fromStrTokIndexOf.
NOTE: In every situation where the parametersint sPos, int ePosare used, parameter'ePos'will accept a negative value, but parameter'sPos'will not. When'ePos'is passed a negative-value, the internalLV('Loop Variable Counter') will have itspublic final int endfield set to the length of the'srcStr'parameterString.
EXCEPTIONS: AnIndexOutOfBoundsExceptionwill be thrown if:- If
sPosis negative, or ifsPosis greater-than or equal-to the size of'srcStr' - If
ePosis zero, or greater than the size'srcStr'. - If
sPosis a larger integer thanePos
String tokenThis is the testing-substring that is this class' search goal. When this Stringis identified as a substring of the input-parameterString 'srcStr', a potential match has been found. In order for potential matches to be returned as results, they are subsequently tested forsurrounding white-space(or the additional'extraDelimiterTest'). The requirements for a potential match to be returned as aToken Matchare as follows:- The location of
'token'in'srcStr'must be bounded by white-space, or be located at the very beginning or ending of the'srcStr'. - If an
extraDelimiterTesthas been provided, the location of'token'in'srcStr'may also be bounded by characters that are a match with theCharacter-Predicate'test(char)'method. - And, of course, the
'token'must be a substring of'srcStr'
char tokenThis parameter is used indentically to parameter String token. However, rather than searching for sub-string matches, the search-loops are looking for copies of character'token'. All the rules listed in the previous parameter entry (above) apply to this parameter too.Predicate<Character> extraDelimiterTestWhen this parameter is present in the method-signature parameter-list, the decision of whether a Token-Matchis to be included in the search result-set can be made less restrictive. Usually, a match must be delimited by white-space; meaning that the characters directly before and after the match location in'srcStr'must be white-space, or theString terminus(Regex:'^'and'$').
However, when this parameter is part of a method signature, the method body in this class that implements this search will also permit atoken-matchlocation to be bounded by characters that pass thisCharacter-Predicate's Predicate.test(char)method.
For instance, if(Character c) -> ",.!?()".contains("" + c)were passed to this parameter, then:commas, periods, exclamation-points, question-marks,andparenthesiswould all be allowed directly before or immediately after thetoken-matchlocation of the'token'parameter insideString 'srcStr'.Return Values:
intrepresents a position index ofStringparameter'srcStr'.- A return value of
-1implies no matches were found. int[]A list of position indices wheretoken-matcheswere found.- A zero-length
int[]array means no matches were found in'srcStr'. Zero-length arrays are returned from any method where the possibility existed for multiple-matches being provided as a result-set. Null will not be returned.
Hi-Lited Source-Code:- View Here: Torello/Java/StrTokIndexOf.java
- Open New Browser-Tab: Torello/Java/StrTokIndexOf.java
File Size: 203,813 Bytes Line Count: 4,750 '\n' Characters Found
Stateless Class:This class neither contains any program-state, nor can it be instantiated. The@StaticFunctionalAnnotation may also be called 'The Spaghetti Report'.Static-Functionalclasses are, essentially, C-Styled Files, without any constructors or non-static member fields. It is a concept very similar to the Java-Bean's@StatelessAnnotation.
- 1 Constructor(s), 1 declared private, zero-argument constructor
- 96 Method(s), 96 declared static
- 0 Field(s)
-
-
Method Summary
All Modifier and Type Method static int[]all(String srcStr, char c)static int[]all(String srcStr, String token)All: Ⅰ Range-Limited Modifier and Type Method static int[]all(String srcStr, int sPos, int ePos, char c)static int[]all(String srcStr, int sPos, int ePos, String token)All: Ⅱ Extra-Delimiter Test Modifier and Type Method static int[]all(String srcStr, char c, Predicate<Character> extraDelimiterTest)static int[]all(String srcStr, String token, Predicate<Character> extraDelimiterTest)All: Ⅰ Range-Limited Ⅱ Extra-Delimiter Test Modifier and Type Method static int[]all(String srcStr, int sPos, int ePos, char c, Predicate<Character> extraDelimiterTest)static int[]all(String srcStr, int sPos, int ePos, String token, Predicate<Character> extraDelimiterTest)All: Ⅲ Case-Insensitive Modifier and Type Method static int[]all_CI(String srcStr, char c)static int[]all_CI(String srcStr, String token)All: Ⅰ Range-Limited Ⅲ Case-Insensitive Modifier and Type Method static int[]all_CI(String srcStr, int sPos, int ePos, char c)static int[]all_CI(String srcStr, int sPos, int ePos, String token)All: Ⅱ Extra-Delimiter Test Ⅲ Case-Insensitive Modifier and Type Method static int[]all_CI(String srcStr, char c, Predicate<Character> extraDelimiterTest)static int[]all_CI(String srcStr, String token, Predicate<Character> extraDelimiterTest)All: Ⅰ Range-Limited Ⅱ Extra-Delimiter Test Ⅲ Case-Insensitive Modifier and Type Method static int[]all_CI(String srcStr, int sPos, int ePos, char c, Predicate<Character> extraDelimiterTest)static int[]all_CI(String srcStr, int sPos, int ePos, String token, Predicate<Character> extraDelimiterTest)First Modifier and Type Method static intfirst(String srcStr, char c)static intfirst(String srcStr, String token)First: Ⅰ Range-Limited Modifier and Type Method static intfirst(String srcStr, int sPos, int ePos, char c)static intfirst(String srcStr, int sPos, int ePos, String token)First: Ⅱ Extra-Delimiter Test Modifier and Type Method static intfirst(String srcStr, char c, Predicate<Character> extraDelimiterTest)static intfirst(String srcStr, String token, Predicate<Character> extraDelimiterTest)First: Ⅰ Range-Limited Ⅱ Extra-Delimiter Test Modifier and Type Method static intfirst(String srcStr, int sPos, int ePos, char c, Predicate<Character> extraDelimiterTest)static intfirst(String srcStr, int sPos, int ePos, String token, Predicate<Character> extraDelimiterTest)First: Ⅲ Case-Insensitive Modifier and Type Method static intfirst_CI(String srcStr, char c)static intfirst_CI(String srcStr, String token)First: Ⅰ Range-Limited Ⅲ Case-Insensitive Modifier and Type Method static intfirst_CI(String srcStr, int sPos, int ePos, char c)static intfirst_CI(String srcStr, int sPos, int ePos, String token)First: Ⅱ Extra-Delimiter Test Ⅲ Case-Insensitive Modifier and Type Method static intfirst_CI(String srcStr, char c, Predicate<Character> extraDelimiterTest)static intfirst_CI(String srcStr, String token, Predicate<Character> extraDelimiterTest)First: Ⅰ Range-Limited Ⅱ Extra-Delimiter Test Ⅲ Case-Insensitive Modifier and Type Method static intfirst_CI(String srcStr, int sPos, int ePos, char c, Predicate<Character> extraDelimiterTest)static intfirst_CI(String srcStr, int sPos, int ePos, String token, Predicate<Character> extraDelimiterTest)Last Modifier and Type Method static intlast(String srcStr, char c)static intlast(String srcStr, String token)Last: Ⅰ Range-Limited Modifier and Type Method static intlast(String srcStr, int sPos, int ePos, char c)static intlast(String srcStr, int sPos, int ePos, String token)Last: Ⅱ Extra-Delimiter Test Modifier and Type Method static intlast(String srcStr, char c, Predicate<Character> extraDelimiterTest)static intlast(String srcStr, String token, Predicate<Character> extraDelimiterTest)Last: Ⅰ Range-Limited Ⅱ Extra-Delimiter Test Modifier and Type Method static intlast(String srcStr, int sPos, int ePos, char c, Predicate<Character> extraDelimiterTest)static intlast(String srcStr, int sPos, int ePos, String token, Predicate<Character> extraDelimiterTest)Last: Ⅲ Case-Insensitive Modifier and Type Method static intlast_CI(String srcStr, char c)static intlast_CI(String srcStr, String token)Last: Ⅰ Range-Limited Ⅲ Case-Insensitive Modifier and Type Method static intlast_CI(String srcStr, int sPos, int ePos, char c)static intlast_CI(String srcStr, int sPos, int ePos, String token)Last: Ⅱ Extra-Delimiter Test Ⅲ Case-Insensitive Modifier and Type Method static intlast_CI(String srcStr, char c, Predicate<Character> extraDelimiterTest)static intlast_CI(String srcStr, String token, Predicate<Character> extraDelimiterTest)Last: Ⅰ Range-Limited Ⅱ Extra-Delimiter Test Ⅲ Case-Insensitive Modifier and Type Method static intlast_CI(String srcStr, int sPos, int ePos, char c, Predicate<Character> extraDelimiterTest)static intlast_CI(String srcStr, int sPos, int ePos, String token, Predicate<Character> extraDelimiterTest)Nth Modifier and Type Method static intnth(String srcStr, int n, char c)static intnth(String srcStr, int n, String token)Nth: Ⅰ Range-Limited Modifier and Type Method static intnth(String srcStr, int sPos, int ePos, int n, char c)static intnth(String srcStr, int sPos, int ePos, int n, String token)Nth: Ⅱ Extra-Delimiter Test Modifier and Type Method static intnth(String srcStr, int n, char c, Predicate<Character> extraDelimiterTest)static intnth(String srcStr, int n, String token, Predicate<Character> extraDelimiterTest)Nth: Ⅰ Range-Limited Ⅱ Extra-Delimiter Test Modifier and Type Method static intnth(String srcStr, int sPos, int ePos, int n, char c, Predicate<Character> extraDelimiterTest)static intnth(String srcStr, int sPos, int ePos, int n, String token, Predicate<Character> extraDelimiterTest)Nth: Ⅲ Case-Insensitive Modifier and Type Method static intnth_CI(String srcStr, int n, char c)static intnth_CI(String srcStr, int n, String token)Nth: Ⅰ Range-Limited Ⅲ Case-Insensitive Modifier and Type Method static intnth_CI(String srcStr, int sPos, int ePos, int n, char c)static intnth_CI(String srcStr, int sPos, int ePos, int n, String token)Nth: Ⅱ Extra-Delimiter Test Ⅲ Case-Insensitive Modifier and Type Method static intnth_CI(String srcStr, int n, char c, Predicate<Character> extraDelimiterTest)static intnth_CI(String srcStr, int n, String token, Predicate<Character> extraDelimiterTest)Nth: Ⅰ Range-Limited Ⅱ Extra-Delimiter Test Ⅲ Case-Insensitive Modifier and Type Method static intnth_CI(String srcStr, int sPos, int ePos, int n, char c, Predicate<Character> extraDelimiterTest)static intnth_CI(String srcStr, int sPos, int ePos, int n, String token, Predicate<Character> extraDelimiterTest)Nth-From-End Modifier and Type Method static intnthFromEnd(String srcStr, int n, char c)static intnthFromEnd(String srcStr, int n, String token)Nth-From-End: Ⅰ Range-Limited Modifier and Type Method static intnthFromEnd(String srcStr, int sPos, int ePos, int n, char c)static intnthFromEnd(String srcStr, int sPos, int ePos, int n, String token)Nth-From-End: Ⅱ Extra-Delimiter Test Modifier and Type Method static intnthFromEnd(String srcStr, int n, char c, Predicate<Character> extraDelimiterTest)static intnthFromEnd(String srcStr, int n, String token, Predicate<Character> extraDelimiterTest)Nth-From-End: Ⅰ Range-Limited Ⅱ Extra-Delimiter Test Modifier and Type Method static intnthFromEnd(String srcStr, int sPos, int ePos, int n, char c, Predicate<Character> extraDelimiterTest)static intnthFromEnd(String srcStr, int sPos, int ePos, int n, String token, Predicate<Character> extraDelimiterTest)Nth-From-End: Ⅲ Case-Insensitive Modifier and Type Method static intnthFromEnd_CI(String srcStr, int n, char c)static intnthFromEnd_CI(String srcStr, int n, String token)Nth-From-End: Ⅰ Range-Limited Ⅲ Case-Insensitive Modifier and Type Method static intnthFromEnd_CI(String srcStr, int sPos, int ePos, int n, char c)static intnthFromEnd_CI(String srcStr, int sPos, int ePos, int n, String token)Nth-From-End: Ⅱ Extra-Delimiter Test Ⅲ Case-Insensitive Modifier and Type Method static intnthFromEnd_CI(String srcStr, int n, char c, Predicate<Character> extraDelimiterTest)static intnthFromEnd_CI(String srcStr, int n, String token, Predicate<Character> extraDelimiterTest)Nth-From-End: Ⅰ Range-Limited Ⅱ Extra-Delimiter Test Ⅲ Case-Insensitive Modifier and Type Method static intnthFromEnd_CI(String srcStr, int sPos, int ePos, int n, char c, Predicate<Character> extraDelimiterTest)static intnthFromEnd_CI(String srcStr, int sPos, int ePos, int n, String token, Predicate<Character> extraDelimiterTest)Left Modifier and Type Method static intleft(String srcStr, int fromIndex, char c)static intleft(String srcStr, int fromIndex, String token)Left: Ⅱ Extra-Delimiter Test Modifier and Type Method static intleft(String srcStr, int fromIndex, char c, Predicate<Character> extraDelimiterTest)static intleft(String srcStr, int fromIndex, String token, Predicate<Character> extraDelimiterTest)Left: Ⅲ Case-Insensitive Modifier and Type Method static intleft_CI(String srcStr, int fromIndex, char c)static intleft_CI(String srcStr, int fromIndex, String token)Left: Ⅱ Extra-Delimiter Test Ⅲ Case-Insensitive Modifier and Type Method static intleft_CI(String srcStr, int fromIndex, char c, Predicate<Character> extraDelimiterTest)static intleft_CI(String srcStr, int fromIndex, String token, Predicate<Character> extraDelimiterTest)Nth-Left Modifier and Type Method static intnthLeft(String srcStr, int fromIndex, int n, char c)static intnthLeft(String srcStr, int fromIndex, int n, String token)Nth-Left: Ⅱ Extra-Delimiter Test Modifier and Type Method static intnthLeft(String srcStr, int fromIndex, int n, char c, Predicate<Character> extraDelimiterTest)static intnthLeft(String srcStr, int fromIndex, int n, String token, Predicate<Character> extraDelimiterTest)Nth-Left: Ⅲ Case-Insensitive Modifier and Type Method static intnthLeft_CI(String srcStr, int fromIndex, int n, char c)static intnthLeft_CI(String srcStr, int fromIndex, int n, String token)Nth-Left: Ⅱ Extra-Delimiter Test Ⅲ Case-Insensitive Modifier and Type Method static intnthLeft_CI(String srcStr, int fromIndex, int n, char c, Predicate<Character> extraDelimiterTest)static intnthLeft_CI(String srcStr, int fromIndex, int n, String token, Predicate<Character> extraDelimiterTest)
-
-
-
Method Detail
-
all_CI
public static int[] all_CI (java.lang.String srcStr, int sPos, int ePos, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for alltoken-matches ofchar-parameter'c'in'srcStr', and return an integer-array of index-locations into'srcStr'indicating where matches have occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an integer-array ofString-index pointers will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- An integer-pointer array of all
java.lang.String-indices where matches were found.The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos); IntStream.Builder b = IntStream.builder(); c = Character.toLowerCase(c); for (int i=l.start; i < l.end; i++) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) b.accept(i); return b.build().toArray();
-
all_CI
public static int[] all_CI(java.lang.String srcStr, int sPos, int ePos, char c)
Search for alltoken-matches ofchar-parameter'c'in'srcStr', and return an integer-array of index-locations into'srcStr'indicating where matches have occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an integer-array ofString-index pointers will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- An integer-pointer array of all
java.lang.String-indices where matches were found.The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos); IntStream.Builder b = IntStream.builder(); c = Character.toLowerCase(c); for (int i=l.start; i < l.end; i++) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) b.accept(i); return b.build().toArray();
-
all_CI
public static int[] all_CI (java.lang.String srcStr, int sPos, int ePos, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for alltoken-matches ofString-param'token'in'srcStr', and return an integer-array of index-locations into'srcStr'indicating where matches have occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an integer-array ofString-index pointers will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- An integer-pointer array of all
java.lang.String-indices where matches were found.The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos, token.length()); IntStream.Builder b = IntStream.builder(); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) b.accept(i); return b.build().toArray();
-
all_CI
public static int[] all_CI(java.lang.String srcStr, int sPos, int ePos, java.lang.String token)
Search for alltoken-matches ofString-param'token'in'srcStr', and return an integer-array of index-locations into'srcStr'indicating where matches have occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an integer-array ofString-index pointers will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- An integer-pointer array of all
java.lang.String-indices where matches were found.The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos, token.length()); IntStream.Builder b = IntStream.builder(); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) b.accept(i); return b.build().toArray();
-
all_CI
public static int[] all_CI (java.lang.String srcStr, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for alltoken-matches ofchar-parameter'c'in'srcStr', and return an integer-array of index-locations into'srcStr'indicating where matches have occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an integer-array ofString-index pointers will be returned.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- An integer-pointer array of all
java.lang.String-indices where matches were found.The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1); IntStream.Builder b = IntStream.builder(); c = Character.toLowerCase(c); for (int i=l.start; i < l.end; i++) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) b.accept(i); return b.build().toArray();
-
all_CI
public static int[] all_CI(java.lang.String srcStr, char c)
Search for alltoken-matches ofchar-parameter'c'in'srcStr', and return an integer-array of index-locations into'srcStr'indicating where matches have occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an integer-array ofString-index pointers will be returned.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- An integer-pointer array of all
java.lang.String-indices where matches were found.The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1); IntStream.Builder b = IntStream.builder(); c = Character.toLowerCase(c); for (int i=l.start; i < l.end; i++) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) b.accept(i); return b.build().toArray();
-
all_CI
public static int[] all_CI (java.lang.String srcStr, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for alltoken-matches ofString-param'token'in'srcStr', and return an integer-array of index-locations into'srcStr'indicating where matches have occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an integer-array ofString-index pointers will be returned.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- An integer-pointer array of all
java.lang.String-indices where matches were found.The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1, token.length()); IntStream.Builder b = IntStream.builder(); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) b.accept(i); return b.build().toArray();
-
all_CI
public static int[] all_CI(java.lang.String srcStr, java.lang.String token)
Search for alltoken-matches ofString-param'token'in'srcStr', and return an integer-array of index-locations into'srcStr'indicating where matches have occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an integer-array ofString-index pointers will be returned.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- An integer-pointer array of all
java.lang.String-indices where matches were found.The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1, token.length()); IntStream.Builder b = IntStream.builder(); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) b.accept(i); return b.build().toArray();
-
all
public static int[] all (java.lang.String srcStr, int sPos, int ePos, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for alltoken-matches ofchar-parameter'c'in'srcStr', and return an integer-array of index-locations into'srcStr'indicating where matches have occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an integer-array ofString-index pointers will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- An integer-pointer array of all
java.lang.String-indices where matches were found.The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos); IntStream.Builder b = IntStream.builder(); for (int i=l.start; i < l.end; i++) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) b.accept(i); return b.build().toArray();
-
all
public static int[] all(java.lang.String srcStr, int sPos, int ePos, char c)
Search for alltoken-matches ofchar-parameter'c'in'srcStr', and return an integer-array of index-locations into'srcStr'indicating where matches have occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an integer-array ofString-index pointers will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- An integer-pointer array of all
java.lang.String-indices where matches were found.The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos); IntStream.Builder b = IntStream.builder(); for (int i=l.start; i < l.end; i++) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) b.accept(i); return b.build().toArray();
-
all
public static int[] all (java.lang.String srcStr, int sPos, int ePos, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for alltoken-matches ofString-param'token'in'srcStr', and return an integer-array of index-locations into'srcStr'indicating where matches have occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an integer-array ofString-index pointers will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- An integer-pointer array of all
java.lang.String-indices where matches were found.The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos, token.length()); IntStream.Builder b = IntStream.builder(); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) b.accept(i); return b.build().toArray();
-
all
public static int[] all(java.lang.String srcStr, int sPos, int ePos, java.lang.String token)
Search for alltoken-matches ofString-param'token'in'srcStr', and return an integer-array of index-locations into'srcStr'indicating where matches have occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an integer-array ofString-index pointers will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- An integer-pointer array of all
java.lang.String-indices where matches were found.The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos, token.length()); IntStream.Builder b = IntStream.builder(); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) b.accept(i); return b.build().toArray();
-
all
public static int[] all (java.lang.String srcStr, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for alltoken-matches ofchar-parameter'c'in'srcStr', and return an integer-array of index-locations into'srcStr'indicating where matches have occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an integer-array ofString-index pointers will be returned.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- An integer-pointer array of all
java.lang.String-indices where matches were found.The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1); IntStream.Builder b = IntStream.builder(); for (int i=l.start; i < l.end; i++) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) b.accept(i); return b.build().toArray();
-
all
public static int[] all(java.lang.String srcStr, char c)
Search for alltoken-matches ofchar-parameter'c'in'srcStr', and return an integer-array of index-locations into'srcStr'indicating where matches have occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an integer-array ofString-index pointers will be returned.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- An integer-pointer array of all
java.lang.String-indices where matches were found.The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1); IntStream.Builder b = IntStream.builder(); for (int i=l.start; i < l.end; i++) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) b.accept(i); return b.build().toArray();
-
all
public static int[] all (java.lang.String srcStr, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for alltoken-matches ofString-param'token'in'srcStr', and return an integer-array of index-locations into'srcStr'indicating where matches have occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an integer-array ofString-index pointers will be returned.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- An integer-pointer array of all
java.lang.String-indices where matches were found.The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1, token.length()); IntStream.Builder b = IntStream.builder(); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) b.accept(i); return b.build().toArray();
-
all
public static int[] all(java.lang.String srcStr, java.lang.String token)
Search for alltoken-matches ofString-param'token'in'srcStr', and return an integer-array of index-locations into'srcStr'indicating where matches have occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an integer-array ofString-index pointers will be returned.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- An integer-pointer array of all
java.lang.String-indices where matches were found.The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1, token.length()); IntStream.Builder b = IntStream.builder(); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) b.accept(i); return b.build().toArray();
-
first_CI
public static int first_CI (java.lang.String srcStr, int sPos, int ePos, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the firsttoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the first identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos); c = Character.toLowerCase(c); for (int i=l.start; i < l.end; i++) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) return i; return -1;
-
first_CI
public static int first_CI(java.lang.String srcStr, int sPos, int ePos, char c)
Search for the firsttoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the first identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos); c = Character.toLowerCase(c); for (int i=l.start; i < l.end; i++) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) return i; return -1;
-
first_CI
public static int first_CI (java.lang.String srcStr, int sPos, int ePos, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the firsttoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the first identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos, token.length()); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
first_CI
public static int first_CI(java.lang.String srcStr, int sPos, int ePos, java.lang.String token)
Search for the firsttoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the first identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos, token.length()); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
first_CI
public static int first_CI (java.lang.String srcStr, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the firsttoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the first identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1); c = Character.toLowerCase(c); for (int i=l.start; i < l.end; i++) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) return i; return -1;
-
first_CI
public static int first_CI(java.lang.String srcStr, char c)
Search for the firsttoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the first identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1); c = Character.toLowerCase(c); for (int i=l.start; i < l.end; i++) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) return i; return -1;
-
first_CI
public static int first_CI (java.lang.String srcStr, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the firsttoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the first identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1, token.length()); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
first_CI
public static int first_CI(java.lang.String srcStr, java.lang.String token)
Search for the firsttoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the first identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1, token.length()); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
first
public static int first (java.lang.String srcStr, int sPos, int ePos, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the firsttoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the first identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos); for (int i=l.start; i < l.end; i++) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) return i; return -1;
-
first
public static int first(java.lang.String srcStr, int sPos, int ePos, char c)
Search for the firsttoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the first identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos); for (int i=l.start; i < l.end; i++) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) return i; return -1;
-
first
public static int first (java.lang.String srcStr, int sPos, int ePos, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the firsttoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the first identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos, token.length()); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
first
public static int first(java.lang.String srcStr, int sPos, int ePos, java.lang.String token)
Search for the firsttoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the first identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos, token.length()); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
first
public static int first (java.lang.String srcStr, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the firsttoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the first identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1); for (int i=l.start; i < l.end; i++) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) return i; return -1;
-
first
public static int first(java.lang.String srcStr, char c)
Search for the firsttoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the first identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1); for (int i=l.start; i < l.end; i++) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) return i; return -1;
-
first
public static int first (java.lang.String srcStr, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the firsttoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the first identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1, token.length()); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
first
public static int first(java.lang.String srcStr, java.lang.String token)
Search for the firsttoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the first identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1, token.length()); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
last_CI
public static int last_CI (java.lang.String srcStr, int sPos, int ePos, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the lasttoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the last identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos); c = Character.toLowerCase(c); for (int i=(l.end-1); i >= l.start; i--) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) return i; return -1;
-
last_CI
public static int last_CI(java.lang.String srcStr, int sPos, int ePos, char c)
Search for the lasttoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the last identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos); c = Character.toLowerCase(c); for (int i=(l.end-1); i >= l.start; i--) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) return i; return -1;
-
last_CI
public static int last_CI (java.lang.String srcStr, int sPos, int ePos, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the lasttoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the last identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos, token.length()); int tokenLen = token.length(); for (int i=(l.end-1); i >= l.start; i--) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
last_CI
public static int last_CI(java.lang.String srcStr, int sPos, int ePos, java.lang.String token)
Search for the lasttoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the last identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos, token.length()); int tokenLen = token.length(); for (int i=(l.end-1); i >= l.start; i--) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
last_CI
public static int last_CI (java.lang.String srcStr, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the lasttoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the last identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1); c = Character.toLowerCase(c); for (int i=(l.end-1); i >= l.start; i--) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) return i; return -1;
-
last_CI
public static int last_CI(java.lang.String srcStr, char c)
Search for the lasttoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the last identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1); c = Character.toLowerCase(c); for (int i=(l.end-1); i >= l.start; i--) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) return i; return -1;
-
last_CI
public static int last_CI (java.lang.String srcStr, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the lasttoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the last identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1, token.length()); int tokenLen = token.length(); for (int i=(l.end-1); i >= l.start; i--) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
last_CI
public static int last_CI(java.lang.String srcStr, java.lang.String token)
Search for the lasttoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the last identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1, token.length()); int tokenLen = token.length(); for (int i=(l.end-1); i >= l.start; i--) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
last
public static int last (java.lang.String srcStr, int sPos, int ePos, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the lasttoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the last identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos); for (int i=(l.end-1); i >= l.start; i--) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) return i; return -1;
-
last
public static int last(java.lang.String srcStr, int sPos, int ePos, char c)
Search for the lasttoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the last identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos); for (int i=(l.end-1); i >= l.start; i--) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) return i; return -1;
-
last
public static int last (java.lang.String srcStr, int sPos, int ePos, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the lasttoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the last identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos, token.length()); int tokenLen = token.length(); for (int i=(l.end-1); i >= l.start; i--) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
last
public static int last(java.lang.String srcStr, int sPos, int ePos, java.lang.String token)
Search for the lasttoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the last identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
- Code:
- Exact Method Body:
LV l = new LV(srcStr, sPos, ePos, token.length()); int tokenLen = token.length(); for (int i=(l.end-1); i >= l.start; i--) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
last
public static int last (java.lang.String srcStr, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the lasttoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the last identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1); for (int i=(l.end-1); i >= l.start; i--) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) return i; return -1;
-
last
public static int last(java.lang.String srcStr, char c)
Search for the lasttoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the last identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1); for (int i=(l.end-1); i >= l.start; i--) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) return i; return -1;
-
last
public static int last (java.lang.String srcStr, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the lasttoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the last identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1, token.length()); int tokenLen = token.length(); for (int i=(l.end-1); i >= l.start; i--) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
last
public static int last(java.lang.String srcStr, java.lang.String token)
Search for the lasttoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the last identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, -1, token.length()); int tokenLen = token.length(); for (int i=(l.end-1); i >= l.start; i--) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
nth_CI
public static int nth_CI (java.lang.String srcStr, int sPos, int ePos, int n, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, sPos, ePos); c = Character.toLowerCase(c); for (int i=l.start; i < l.end; i++) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nth_CI
public static int nth_CI(java.lang.String srcStr, int sPos, int ePos, int n, char c)
Search for the nthtoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, sPos, ePos); c = Character.toLowerCase(c); for (int i=l.start; i < l.end; i++) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nth_CI
public static int nth_CI (java.lang.String srcStr, int sPos, int ePos, int n, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, sPos, ePos, token.length()); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
nth_CI
public static int nth_CI(java.lang.String srcStr, int sPos, int ePos, int n, java.lang.String token)
Search for the nthtoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, sPos, ePos, token.length()); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
nth_CI
public static int nth_CI (java.lang.String srcStr, int n, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, -1); c = Character.toLowerCase(c); for (int i=l.start; i < l.end; i++) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nth_CI
public static int nth_CI(java.lang.String srcStr, int n, char c)
Search for the nthtoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, -1); c = Character.toLowerCase(c); for (int i=l.start; i < l.end; i++) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nth_CI
public static int nth_CI (java.lang.String srcStr, int n, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, -1, token.length()); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
nth_CI
public static int nth_CI(java.lang.String srcStr, int n, java.lang.String token)
Search for the nthtoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, -1, token.length()); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
nth
public static int nth (java.lang.String srcStr, int sPos, int ePos, int n, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, sPos, ePos); for (int i=l.start; i < l.end; i++) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nth
public static int nth(java.lang.String srcStr, int sPos, int ePos, int n, char c)
Search for the nthtoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, sPos, ePos); for (int i=l.start; i < l.end; i++) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nth
public static int nth (java.lang.String srcStr, int sPos, int ePos, int n, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, sPos, ePos, token.length()); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
nth
public static int nth(java.lang.String srcStr, int sPos, int ePos, int n, java.lang.String token)
Search for the nthtoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, sPos, ePos, token.length()); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
nth
public static int nth (java.lang.String srcStr, int n, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, -1); for (int i=l.start; i < l.end; i++) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nth
public static int nth(java.lang.String srcStr, int n, char c)
Search for the nthtoken-match ofchar-parameter'c'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, -1); for (int i=l.start; i < l.end; i++) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nth
public static int nth (java.lang.String srcStr, int n, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, -1, token.length()); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
nth
public static int nth(java.lang.String srcStr, int n, java.lang.String token)
Search for the nthtoken-match ofString-param'token'in'srcStr', and return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, -1, token.length()); int tokenLen = token.length(); for (int i=l.start; i < l.end; i++) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
nthFromEnd_CI
public static int nthFromEnd_CI (java.lang.String srcStr, int sPos, int ePos, int n, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofchar-parameter'c'but start the search with the last character of the String, and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr', counting left from the end of'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, sPos, ePos); c = Character.toLowerCase(c); for (int i=(l.end-1); i >= l.start; i--) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nthFromEnd_CI
public static int nthFromEnd_CI(java.lang.String srcStr, int sPos, int ePos, int n, char c)
Search for the nthtoken-match ofchar-parameter'c'but start the search with the last character of the String, and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr', counting left from the end of'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, sPos, ePos); c = Character.toLowerCase(c); for (int i=(l.end-1); i >= l.start; i--) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nthFromEnd_CI
public static int nthFromEnd_CI (java.lang.String srcStr, int sPos, int ePos, int n, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofString-param'token'but start the search with the last character of the String, and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr', counting left from the end of'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, sPos, ePos, token.length()); int tokenLen = token.length(); for (int i=(l.end-1); i >= l.start; i--) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
nthFromEnd_CI
public static int nthFromEnd_CI(java.lang.String srcStr, int sPos, int ePos, int n, java.lang.String token)
Search for the nthtoken-match ofString-param'token'but start the search with the last character of the String, and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr', counting left from the end of'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, sPos, ePos, token.length()); int tokenLen = token.length(); for (int i=(l.end-1); i >= l.start; i--) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
nthFromEnd_CI
public static int nthFromEnd_CI (java.lang.String srcStr, int n, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofchar-parameter'c'but start the search with the last character of the String, and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr', counting left from the end of'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, -1); c = Character.toLowerCase(c); for (int i=(l.end-1); i >= l.start; i--) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nthFromEnd_CI
public static int nthFromEnd_CI(java.lang.String srcStr, int n, char c)
Search for the nthtoken-match ofchar-parameter'c'but start the search with the last character of the String, and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr', counting left from the end of'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, -1); c = Character.toLowerCase(c); for (int i=(l.end-1); i >= l.start; i--) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nthFromEnd_CI
public static int nthFromEnd_CI (java.lang.String srcStr, int n, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofString-param'token'but start the search with the last character of the String, and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr', counting left from the end of'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, -1, token.length()); int tokenLen = token.length(); for (int i=(l.end-1); i >= l.start; i--) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
nthFromEnd_CI
public static int nthFromEnd_CI(java.lang.String srcStr, int n, java.lang.String token)
Search for the nthtoken-match ofString-param'token'but start the search with the last character of the String, and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr', counting left from the end of'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, -1, token.length()); int tokenLen = token.length(); for (int i=(l.end-1); i >= l.start; i--) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
nthFromEnd
public static int nthFromEnd (java.lang.String srcStr, int sPos, int ePos, int n, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofchar-parameter'c'but start the search with the last character of the String, and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr', counting left from the end of'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, sPos, ePos); for (int i=(l.end-1); i >= l.start; i--) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nthFromEnd
public static int nthFromEnd(java.lang.String srcStr, int sPos, int ePos, int n, char c)
Search for the nthtoken-match ofchar-parameter'c'but start the search with the last character of the String, and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr', counting left from the end of'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, sPos, ePos); for (int i=(l.end-1); i >= l.start; i--) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nthFromEnd
public static int nthFromEnd (java.lang.String srcStr, int sPos, int ePos, int n, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofString-param'token'but start the search with the last character of the String, and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr', counting left from the end of'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, sPos, ePos, token.length()); int tokenLen = token.length(); for (int i=(l.end-1); i >= l.start; i--) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
nthFromEnd
public static int nthFromEnd(java.lang.String srcStr, int sPos, int ePos, int n, java.lang.String token)
Search for the nthtoken-match ofString-param'token'but start the search with the last character of the String, and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitiveThis method allows sub-sections, or 'partial-sections', of thejava.lang.Stringto be checked. This is done via theint 'sPos'and theint 'ePos'parameters. These are indices into the'srcStr'input-parameter.- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.sPos- This is the integer-indexString-location which limits the left-most position to search in'srcStr'. This value is 'inclusive,' meaning that if the character at this index (in'srcStr') is part of a match, it shall be factored into the return results.Note that if this value is negative, or larger than the length of'srcStr', an exception will be thrown.ePos- This is the integer-indexString-location which limits the right-most position to search in'srcStr'. This value is 'exclusive' meaning that if the character at this location is part of match, it will not be calculated into the results.If this value is larger than the length of input-parameter'srcStr', an exception will throw.
Passing a negative value to this parameter,'ePos', will cause its to be reset to the integer-value:srcStr.length()n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr', counting left from the end of'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
java.lang.StringIndexOutOfBoundsException- This exception shall be thrown if any of the following are true:- If
'sPos'is negative, or ifsPosis greater-than-or-equal-to thelengthof theString - If
'ePos'is zero, or greater than the length of theString - If the value of
'sPos'is a larger integer than'ePos'. IfePoswas negative, it is first reset toString.length(), before this check is done.
- If
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, sPos, ePos, token.length()); int tokenLen = token.length(); for (int i=(l.end-1); i >= l.start; i--) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
nthFromEnd
public static int nthFromEnd (java.lang.String srcStr, int n, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofchar-parameter'c'but start the search with the last character of the String, and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr', counting left from the end of'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, -1); for (int i=(l.end-1); i >= l.start; i--) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nthFromEnd
public static int nthFromEnd(java.lang.String srcStr, int n, char c)
Search for the nthtoken-match ofchar-parameter'c'but start the search with the last character of the String, and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr', counting left from the end of'srcStr'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, -1); for (int i=(l.end-1); i >= l.start; i--) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nthFromEnd
public static int nthFromEnd (java.lang.String srcStr, int n, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofString-param'token'but start the search with the last character of the String, and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr', counting left from the end of'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, -1, token.length()); int tokenLen = token.length(); for (int i=(l.end-1); i >= l.start; i--) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
nthFromEnd
public static int nthFromEnd(java.lang.String srcStr, int n, java.lang.String token)
Search for the nthtoken-match ofString-param'token'but start the search with the last character of the String, and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr', counting left from the end of'srcStr'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, -1, token.length()); int tokenLen = token.length(); for (int i=(l.end-1); i >= l.start; i--) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
left_CI
public static int left_CI (java.lang.String srcStr, int fromIndex, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the firsttoken-match ofchar-parameter'c'searching left beginning at'srcStr'position'fromIndex'. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.fromIndex- This is the right-most index-position in'srcStr'(*INCLUSIVE*) from where the search shall start.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr', performing the search in the left direction, beginning atString-index'fromIndex'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, fromIndex); c = Character.toLowerCase(c); for (int i=l.end; i >= 0; i--) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) return i; return -1;
-
left_CI
public static int left_CI(java.lang.String srcStr, int fromIndex, char c)
Search for the firsttoken-match ofchar-parameter'c'searching left beginning at'srcStr'position'fromIndex'. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.fromIndex- This is the right-most index-position in'srcStr'(*INCLUSIVE*) from where the search shall start.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr', performing the search in the left direction, beginning atString-index'fromIndex'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, fromIndex); c = Character.toLowerCase(c); for (int i=l.end; i >= 0; i--) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) return i; return -1;
-
left_CI
public static int left_CI (java.lang.String srcStr, int fromIndex, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the firsttoken-match ofString-param'token'searching left beginning at'srcStr'position'fromIndex'. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.fromIndex- This is the right-most index-position in'srcStr'(*INCLUSIVE*) from where the search shall start.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr', performing the search in the left direction, beginning atString-index'fromIndex'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, fromIndex, token.length()); int tokenLen = token.length(); for (int i=l.end; i >= 0; i--) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
left_CI
public static int left_CI(java.lang.String srcStr, int fromIndex, java.lang.String token)
Search for the firsttoken-match ofString-param'token'searching left beginning at'srcStr'position'fromIndex'. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.fromIndex- This is the right-most index-position in'srcStr'(*INCLUSIVE*) from where the search shall start.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr', performing the search in the left direction, beginning atString-index'fromIndex'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, fromIndex, token.length()); int tokenLen = token.length(); for (int i=l.end; i >= 0; i--) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
left
public static int left (java.lang.String srcStr, int fromIndex, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the firsttoken-match ofchar-parameter'c'searching left beginning at'srcStr'position'fromIndex'. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.fromIndex- This is the right-most index-position in'srcStr'(*INCLUSIVE*) from where the search shall start.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr', performing the search in the left direction, beginning atString-index'fromIndex'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, fromIndex); for (int i=l.end; i >= 0; i--) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) return i; return -1;
-
left
public static int left(java.lang.String srcStr, int fromIndex, char c)
Search for the firsttoken-match ofchar-parameter'c'searching left beginning at'srcStr'position'fromIndex'. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.fromIndex- This is the right-most index-position in'srcStr'(*INCLUSIVE*) from where the search shall start.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr', performing the search in the left direction, beginning atString-index'fromIndex'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, fromIndex); for (int i=l.end; i >= 0; i--) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) return i; return -1;
-
left
public static int left (java.lang.String srcStr, int fromIndex, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the firsttoken-match ofString-param'token'searching left beginning at'srcStr'position'fromIndex'. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.fromIndex- This is the right-most index-position in'srcStr'(*INCLUSIVE*) from where the search shall start.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr', performing the search in the left direction, beginning atString-index'fromIndex'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, fromIndex, token.length()); int tokenLen = token.length(); for (int i=l.end; i >= 0; i--) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
left
public static int left(java.lang.String srcStr, int fromIndex, java.lang.String token)
Search for the firsttoken-match ofString-param'token'searching left beginning at'srcStr'position'fromIndex'. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.fromIndex- This is the right-most index-position in'srcStr'(*INCLUSIVE*) from where the search shall start.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr', performing the search in the left direction, beginning atString-index'fromIndex'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Code:
- Exact Method Body:
LV l = new LV(srcStr, 0, fromIndex, token.length()); int tokenLen = token.length(); for (int i=l.end; i >= 0; i--) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) return i; return -1;
-
nthLeft_CI
public static int nthLeft_CI (java.lang.String srcStr, int fromIndex, int n, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofchar-parameter'c'in'srcStr', but begin the search at index-position'fromIndex'and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.fromIndex- This is the right-most index-position in'srcStr'(*INCLUSIVE*) from where the search shall start.n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr', performing the search in the left direction, beginning atString-index'fromIndex'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, fromIndex); c = Character.toLowerCase(c); for (int i=l.end; i >= 0; i--) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nthLeft_CI
public static int nthLeft_CI(java.lang.String srcStr, int fromIndex, int n, char c)
Search for the nthtoken-match ofchar-parameter'c'in'srcStr', but begin the search at index-position'fromIndex'and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.fromIndex- This is the right-most index-position in'srcStr'(*INCLUSIVE*) from where the search shall start.n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr', performing the search in the left direction, beginning atString-index'fromIndex'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, fromIndex); c = Character.toLowerCase(c); for (int i=l.end; i >= 0; i--) if ( (c == Character.toLowerCase(srcStr.charAt(i))) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nthLeft_CI
public static int nthLeft_CI (java.lang.String srcStr, int fromIndex, int n, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofString-param'token'in'srcStr', but begin the search at index-position'fromIndex'and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.fromIndex- This is the right-most index-position in'srcStr'(*INCLUSIVE*) from where the search shall start.n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr', performing the search in the left direction, beginning atString-index'fromIndex'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, fromIndex, token.length()); int tokenLen = token.length(); for (int i=l.end; i >= 0; i--) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
nthLeft_CI
public static int nthLeft_CI(java.lang.String srcStr, int fromIndex, int n, java.lang.String token)
Search for the nthtoken-match ofString-param'token'in'srcStr', but begin the search at index-position'fromIndex'and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are not ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.fromIndex- This is the right-most index-position in'srcStr'(*INCLUSIVE*) from where the search shall start.n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr', performing the search in the left direction, beginning atString-index'fromIndex'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, fromIndex, token.length()); int tokenLen = token.length(); for (int i=l.end; i >= 0; i--) if ( srcStr.regionMatches(true, i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
nthLeft
public static int nthLeft (java.lang.String srcStr, int fromIndex, int n, char c, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofchar-parameter'c'in'srcStr', but begin the search at index-position'fromIndex'and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.fromIndex- This is the right-most index-position in'srcStr'(*INCLUSIVE*) from where the search shall start.n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputchar 'c'parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr', performing the search in the left direction, beginning atString-index'fromIndex'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, fromIndex); for (int i=l.end; i >= 0; i--) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1)) || extraDelimiterTest.test(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nthLeft
public static int nthLeft(java.lang.String srcStr, int fromIndex, int n, char c)
Search for the nthtoken-match ofchar-parameter'c'in'srcStr', but begin the search at index-position'fromIndex'and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.fromIndex- This is the right-most index-position in'srcStr'(*INCLUSIVE*) from where the search shall start.n- This is the number of matches to skip when searching forchar-parameter'c'before returning an answer.c- This is the character that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Charactermatch in'srcStr', performing the search in the left direction, beginning atString-index'fromIndex'The concept of achar-TOKENmatch will be defined as nearly identical to a regular'contains-character'match, with the added requirement that BOTH the character directly preceding the matching-charAND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, fromIndex); for (int i=l.end; i >= 0; i--) if ( (c == srcStr.charAt(i)) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i+1) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i+1))) ) if (--n == 0) return i; return -1;
-
nthLeft
public static int nthLeft (java.lang.String srcStr, int fromIndex, int n, java.lang.String token, java.util.function.Predicate<java.lang.Character> extraDelimiterTest)
Search for the nthtoken-match ofString-param'token'in'srcStr', but begin the search at index-position'fromIndex'and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.fromIndex- This is the right-most index-position in'srcStr'(*INCLUSIVE*) from where the search shall start.n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.extraDelimiterTest- When this method makestokencomparisons using the inputString-token parameter, if the logic finds a match anywhere withinStringparameter'srcStr', it will check both the character immediately preceding and the character directly after that match before considering the match as a token-match. ThisPredicate<Character>test allows the programmer to identify characters in addition to white-space that identify the match as a token match.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr', performing the search in the left direction, beginning atString-index'fromIndex'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
④ Any character that matches the user-providedPredicate<Character> 'extraDelimiterTest'
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, fromIndex, token.length()); int tokenLen = token.length(); for (int i=l.end; i >= 0; i--) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1)) || extraDelimiterTest.test(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen)) || extraDelimiterTest.test(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
nthLeft
public static int nthLeft(java.lang.String srcStr, int fromIndex, int n, java.lang.String token)
Search for the nthtoken-match ofString-param'token'in'srcStr', but begin the search at index-position'fromIndex'and work left. Return the integer index-location into'srcStr'where the match occured.The comparisons performed ** are ** case-sensitive- Parameters:
srcStr- This may be anyjava.lang.String. Its contents will be searched for the specifiedtoken-matches, and an an index-pointer (an integer) will be returned.fromIndex- This is the right-most index-position in'srcStr'(*INCLUSIVE*) from where the search shall start.n- This is the number of matches to skip when searching forString-param'token'before returning an answer.token- This is the sub-string that will be 'searched-for' in input-parameterString 'srcStr'.- Returns:
- The
'srcStr' String-index of the nth identifiedTOKEN-Stringmatch in'srcStr', performing the search in the left direction, beginning atString-index'fromIndex'The concept of aTOKENmatch will be defined as nearly identical to a sub-string match, with the added requirement that BOTH the character directly preceding the sub-string match AND the character immediately following it may only equal one of these values:
① white-space (matching'\s')
②String-start (matching'^')
③String-terminus (matching'$')
- Throws:
NException- If the value of'n'is negative, or greater thansrcStr.length(), this exception shall throw.- Code:
- Exact Method Body:
NException.check(n, srcStr); LV l = new LV(srcStr, 0, fromIndex, token.length()); int tokenLen = token.length(); for (int i=l.end; i >= 0; i--) if ( srcStr.regionMatches(i, token, 0, tokenLen) && ( (i==0) || Character.isWhitespace(srcStr.charAt(i-1))) && ( ((i + tokenLen) == srcStr.length()) || Character.isWhitespace(srcStr.charAt(i + tokenLen))) ) if (--n == 0) return i; return -1;
-
-