Skip to content

String Query Operations

Malcolm Groves edited this page Jan 9, 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.
First Yes Yes Enumerate the first string, ignoring the remainder.
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.
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.
Predicate Yes Yes Returns a TPredicate<String> encapsulating the supplied Unbound Query logic.
SkipWhile 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.
StartsWith Yes Yes Enumerates strings that start with the supplied string.
Take Yes Yes Take will enumerate up to the specified number of strings, then ignore the remainder.
TakeWhile Yes Yes TakeWhile will continue enumerating strings while the supplied Predicate evaluates True, after which it will ignore the remaining strings.
ToTStrings Yes Yes Returns a TStrings object containing the Strings that match the query
Where Yes Yes Filter the strings enumerated to only those that evaluate true when passed into the supplied Predicate

Note, all String Query Operations can be either case-sensitive or case-insensitive, but are case-insensitive by default.

Clone this wiki locally