toSemVer

Convert a string to a SemVer.

An invalid string is returned as a SemVer with version 0.0.0.

@safe
toSemVer
(
string s
)

Examples

Example.

import std.stdio : writeln;

assert(toSemVer("1.2.3") == [1, 2, 3]);
assert(toSemVer("1.2") == [1, 2, 0]);
assert(toSemVer("1") == [1, 0, 0]);
assert(toSemVer("1.2.3.4") == [0, 0, 0]);

Meta