User:Rominet/Sandbox: Difference between revisions

Jump to navigation Jump to search
→‎String substitution: Contrary to String.sub(), Ustring.sub() doesn't trigger an error when the end index exceeds the input string length
(→‎String substitution: Test 'sub' function from Module:String and Module:Ustring ⇒ works, thanks Gijs!)
(→‎String substitution: Contrary to String.sub(), Ustring.sub() doesn't trigger an error when the end index exceeds the input string length)
 
Line 47: Line 47:
  {{obr}}#invoke:Ustring{{!}}sub{{!}}s1=abcde{{!}}2{{!}}4{{cbr}}
  {{obr}}#invoke:Ustring{{!}}sub{{!}}s1=abcde{{!}}2{{!}}4{{cbr}}
⇒ {{#invoke:Ustring|sub|s1=abcde|2|4}}
⇒ {{#invoke:Ustring|sub|s1=abcde|2|4}}
{{obr}}#invoke:Ustring{{!}}sub{{!}}s1=abcde{{!}}2{{!}}50{{cbr}}
⇒ {{#invoke:Ustring|sub|s1=abcde|2|50}}
   
   
<code>{{obr}}padleft{{cbr}}</code> is available too, but isn't quite appropriate for the sake of truncating commit ids in [[Template:Repo_link]]:
<code>{{obr}}padleft{{cbr}}</code> is available too, but isn't quite appropriate for the sake of truncating commit ids in [[Template:Repo_link]]:
512

edits

Navigation menu