- Preparing search index...
- The search index is not available
Kombo - v3.0.0
- isSubChar(predicate: ((src: string) => boolean), offset: number, string: string): number
-
Parameters
-
predicate: ((src: string) => boolean)
-
- (src: string): boolean
-
Returns boolean
-
offset: number
-
string: string
Returns number
Again, when parsing, you want to allocate as little as possible. So this function lets you say:
The
(Char -> Bool)
argument is called a predicate. ThenewOffset
value can be a few different things:-1
means that the predicate failed-2
means the predicate succeeded with a\n
offset + 1
oroffset + 2
depending on whether the UTF16 character is one or two words wide.