Data update
This commit is contained in:
parent
29a5eea0d4
commit
5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions
|
|
@ -0,0 +1,13 @@
|
|||
module Substrings {
|
||||
void run(String[] args = []) {
|
||||
String s = args.size > 0 ? args[0] : "hello";
|
||||
@Inject Console console;
|
||||
console.print(
|
||||
$|Original : { s .quoted()=}
|
||||
|Remove first: { s.substring(1) .quoted()=}
|
||||
|Remove first: {(s.size < 1 ? "" : s[1..<s.size ]).quoted()=}
|
||||
|Remove last : {(s.size < 1 ? "" : s[0..<s.size-1]).quoted()=}
|
||||
|Remove both : {(s.size < 2 ? "" : s[1..<s.size-1]).quoted()=}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
{$zerobasedstrings}
|
||||
begin
|
||||
var s := '0123456789';
|
||||
Writeln(s[1:]);
|
||||
Writeln(s[:^1]);
|
||||
Writeln(s[1:^1]);
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue