Helpers



[1]
strX.enclose( {preStr {,sufStr} ) enclose
  Returns <strX>/ <err>
  preStr String to prefix
  sufStr String to suffix
     
  Description Returns a new string object, which is the result of prefixing preStr, and suffixing sufStr to strX.
If sufStr is not defined, preStr will be used as sufStr.
If preStr is not defined, strX will be enclosed in double quotes (")
     
  Examples s=_s("word")
put s
-- word
put s.enclose()
-- "word"
put s.enclose("-")
-- -word-
put s.enclose("<-", "->")
-- <-word->
     
  Notes  

[2]
strX.leCR() line endings CR
  Returns <strX>/ <err>
     
  Description Replaces all CRLF and LF characters found in strX with CR (return)
Returns a new string, or <err> if the operation fails
     
  Examples s=_scs(65, 13,10, 66, 10)
put s.leCR().bList()
-- [65, 13, 66, 13]
     
  Notes This command is useful when importing text files (that usually use CRLF) instead of CR that is used as line ending by Director.

[3]
strX.leCRLF() line endings CRLF
  Returns <strX>/ <err>
     
  Description Replaces all CR and LF characters found in strX with CRLF
Returns a new string, or <err> if the operation fails
     
  Examples s=_scs(65, 13, 66, 10)
put s.leCRLF().bList()
-- [65, 13, 10, 66, 13, 10]
     
  Notes This command is useful for converting Director's CR line ending characters to the standard CRLF characters before saving the string's contents to a file that is to be accessed by third party applications.