Function DesktopFile.splitValues

Some keys can have multiple values, separated by semicolon. This function helps to parse such kind of strings into the range.

auto static std.algorithm.iteration.FilterResult!(desktopfile.file.DesktopFile.splitValues(string).__lambda2,desktopfile.file.DesktopFile.SplitValues) splitValues (
  string values
) pure nothrow @trusted;

Returns

The range of multiple nonempty values.

Note

Returned range unescapes ';' character automatically.

See Also

joinValues

Example

assert(DesktopFile.splitValues("").empty);
assert(DesktopFile.splitValues(";").empty);
assert(DesktopFile.splitValues(";;;").empty);
assert(equal(DesktopFile.splitValues("Application;Utility;FileManager;"), ["Application", "Utility", "FileManager"]));
assert(equal(DesktopFile.splitValues("I\\;Me;\\;You\\;We\\;"), ["I;Me", ";You;We;"]));

auto values = DesktopFile.splitValues("Application;Utility;FileManager;");
assert(values.front == "Application");
values.popFront();
assert(equal(values, ["Utility", "FileManager"]));
auto saved = values.save;
values.popFront();
assert(equal(values, ["FileManager"]));
assert(equal(saved, ["Utility", "FileManager"]));