Posted By

reboltutorial on 04/23/10


Tagged

REBOL


Versions (?)

String Utils


 / Published in: R
 

URL: http://reboltutorial.com

  1. enquote: func[sentence [string!]][
  2. rejoin [{"} sentence {"}]
  3. ]
  4.  
  5. pad: func[value [string! integer!] nzero [integer!]][
  6.  
  7. value: to-string value
  8. if/else ((ndiff: nzero - (length? value)) > 0) [
  9. for i 1 ndiff 1 [
  10. value: rejoin ["0" value]
  11. ]
  12. ][
  13. value
  14. ]
  15. ]

Report this snippet  

You need to login to post a comment.