StartsWith
Declaring type: String
Module: System
Assembly: System.Runtime.dll
Source file: String.rvn
Overloads / Variants
StartsWith
func StartsWith(prefix: string, comparison: StringComparison) -> bool
Source file: String.rvn
Tests whether text starts with the supplied text using an explicit policy.
Parameters
| Name | Type | Description |
|---|---|---|
prefix |
String | Non-null text to match; empty matches for every valid policy. |
comparison |
StringComparison | Canonical matches complete graphemes; Ordinal matches bytes; OrdinalIgnoreCase matches simple-folded scalars without normalization or expansion. |
Return value
True when a match is found.
Remarks
Development API. Unknown modes fault with RuntimeError, including empty patterns. Ordinal modes may match inside graphemes. No cultural matching, temporary strings or arrays. Preserves UTF-8 bytes. Candidate scans can repeat prefix work; no linear-time guarantee.
StartsWith
func StartsWith(prefix: string) -> bool
Source file: String.rvn
Tests whether text starts with the supplied text by canonical whole-grapheme matching.
Parameters
| Name | Type | Description |
|---|---|---|
prefix |
String | Non-null text to match; empty always matches. |
Return value
True when a match is found.
Remarks
Development API. Preserves UTF-8 bytes without temporary strings or arrays. Does not match part of a grapheme. Candidate scans can repeat prefix work; no linear-time guarantee.