Class StringList
#include <StringList.h >
Super class: string
A class to manage an ordered list of strings. This is not a set; a string may appear on the list multiple times.
Note: by default, a string must not contain a comma to leverage this class's full functionality. A different separator character can be used if commas are needed in the strings.
Constructor. Create an empty list of strings.
const string& element |
a string to check |
Locate the position of a string in the string list.
Return value: the position, 0+ or -1 on error
const string& element |
the string to locate and remove |
Remove a string from the list.
Return value: true if string found and removed
const StringList& other_list |
the list of string to remove |
Remove a list of strings from the list.
Return value: true if string at least one string was found and removed
const string& oldtext |
the string to locate |
const string& newtext |
the replacement string |
bool all |
if true, check whole list (don't stop at first match) Default value: false |
Replace a string in the list with a new string.
Return value: true if at least one string was found and replaced
Alphabetically sort the list of strings.
Return value: the instance back
const StringList& a |
other string list to add |
Add a string list to this string list.
Return value: combined string list
const StringList& a |
other string list to add |
Add/Append another string list to this string list.
Return value: combined string list
const StringList& a |
other string list to remove |
Remove a string list from this string list. All strings found in a will be removed from this StringList, if present.
Return value: combined string list
const StringList& a |
other string list to remove |
Remove a string list from this string list. All strings found in a will be removed from this StringList, if present.
Return value: combined string list
const StringList& b |
other string list |
Compare two string lists to determine if they are the same.
The order of the strings in the list does not matter.
Return value: true if the lists are the same; false if they are not
const string& a |
left string to compare |
const string& b |
right string to compare |
Compare two strings to determine if a > b.
Return value: true if a is lexicographically later/bigger than b