-
Notifications
You must be signed in to change notification settings - Fork 43
String Query Operations
Malcolm Groves edited this page May 28, 2014
·
9 revisions
FluentQuery supports the following operations when querying strings from a container (eg, a TStrings, or a TList<Strings>):
| Operation | Bound | Unbound | Terminating | Description |
|---|---|---|---|---|
| Contains | Yes | Yes | Enumerates string that contain the supplied string. | |
| EndsWith | Yes | Yes | Enumerates strings that end with the supplied string. | |
| Equals | Yes | Yes | Enumerates strings that are exact, case-sensitive matches to the supplied string. | |
| First | Yes | Yes | Enumerate the first string, ignoring the remainder. | |
| From | Yes | From allows you to specify the source of the data you are querying. It is also From which transforms an Unbound Query into a Bound Query. | ||
| Matches | Yes | Yes | Enumerates strings that match the supplied string. | |
| NotEquals | Yes | Yes | Enumerates strings that are not exact, case-sensitive matches to the supplied string. | |
| Predicate | Yes | Yes | Returns a TPredicate<String> encapsulating the supplied Unbound Query logic. | |
| Skip | Yes | Yes | Skip will bypass the specified number of strings from the start of the enumeration, after which it will enumerate the remaining strings as normal. | |
| SkipWhile(Predicate) | Yes | Yes | SkipWhile will bypass strings at the start of the enumeration while the supplied Predicate evaluates True. Once the Predicate evaluates false, all remaining strings will be enumerated as normal. | |
| SkipWhile(UnboundQuery) | Yes | Yes | SkipWhile will bypass strings at the start of the enumeration that match the supplied Unbound Query. Once a string does not match the supplied query, all remaining strings will be enumerated as normal. | |
| StartsWith | Yes | Yes | Enumerates strings that start with the supplied string. | |
| Substring | Yes | Yes | Enumerates each string, returning a substring given a StartingIndex and an optional Length. Subsequent query operations will only enumerate the substring, not the original string. | |
| Take | Yes | Yes | Take will enumerate up to the specified number of strings, then ignore the remainder. | |
| TakeWhile(Predicate) | Yes | Yes | TakeWhile will continue enumerating strings while the supplied Predicate evaluates True, after which it will ignore the remaining strings. | |
| TakeWhile(UnboundQuery) | Yes | Yes | TakeWhile will continue enumerating strings while they match the supplied Unbound Query, after which it will ignore the remaining strings. | |
| ToTStrings | Yes | Yes | Returns a TStrings object containing the Strings that match the query | |
| Value | Yes | Yes | Enumerates Name=Value strings, returning the Value portion for the supplied name. | |
| Where(Predicate) | Yes | Yes | Filter the strings enumerated to only those that evaluate true when passed into the supplied Predicate | |
| WhereNot(Predicate) | Yes | Yes | Filter the strings enumerated to only those that evaluate false when passed into the supplied Predicate | |
| WhereNot(UnboundQuery) | Yes | Yes | Filter the strings enumerated to only those that do not match the supplied Unbound Query |
Note, unless otherwise stated, all String Query Operations can be either case-sensitive or case-insensitive, but are case-insensitive by default.