March 2014 update
This commit is contained in:
parent
09687c4926
commit
a25938f123
1846 changed files with 21876 additions and 5203 deletions
|
|
@ -1,12 +1,12 @@
|
|||
import std.stdio, std.regex;
|
||||
|
||||
void main() {
|
||||
immutable string s = "I am a string";
|
||||
import std.stdio, std.regex;
|
||||
|
||||
// Test:
|
||||
if (!match(s, r"string$").empty)
|
||||
writeln("Ends with 'string'.");
|
||||
immutable s = "I am a string";
|
||||
|
||||
// Substitute:
|
||||
replace(s, regex(" a "), " another ").writeln();
|
||||
// Test.
|
||||
if (!s.match(r"string$").empty)
|
||||
"Ends with 'string'.".writeln;
|
||||
|
||||
// Substitute.
|
||||
s.replace(" a ".regex, " another ").writeln;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue