Product Site

5.1.7.88. space

Returns a copy of receiving string, with n pad characters between each whitespace-delimited word. If you specify n, it must be a positive whole number or zero. If it is 0, all whitespace characters are removed. Leading and trailing whitespace characters are always removed. The default for n is 1, and the default pad character is a blank.
Example 5.124. String class — space method
"abc  def  "~space           -->    "abc def"
"  abc def"~space(3)         -->    "abc   def"
"abc  def  "~space(1)        -->    "abc def"
"abc  def  "~space(0)        -->    "abcdef"
"abc  def  "~space(2,"+")    -->    "abc++def"