fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 216: Pad a string in the center
Idiom # 216: Pad a string in the center
See
programming-idioms.org
:
Code
p := c * (((m - s.codepoint_length + 1).max 0) / 2) p + s + p
What are effects?
Running Example
ex216 is s := "融合слияниеذوب" c := "❗" m := 15 p := c * ((max 0 (m - s.codepoint_length + 1)) / 2) s2 := p + s + p say s2
What are effects?
last changed: 2024-07-01
next: NYI: Idiom # 217: Create a Zip archive