Browse Source

adding abbr() function

master
Volker Birk 9 months ago
parent
commit
99a683e07f
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      yml2/standardlib.ysl2

+ 6
- 0
yml2/standardlib.ysl2 View File

@ -73,3 +73,9 @@ def "yml:CamelCase" {
result "str:concat($capit)";
}
def "yml:abbr" {
param "text", "''";
const "tokens", "str:tokenize($text, '_')";
const "first" for "$tokens" value "substring(.,1,1)";
result "str:concat($first)";
}

Loading…
Cancel
Save