StringFormat()
Posted: Wed Mar 06, 2013 9:23 am
I think PureBasic would be better served to support:
And
(and this is the important part)
Note that a single \ remains such, important when dealing with file paths for example.
However, PureBasic may benefit much more from a StringFormat() function that supports this,
thus letting normal strings remain such (and fast processing since it's just concatenation),
Thus:
Would be the same as doing:
Oh and StringFormat() is just a suggestion on what to call this function.
Code: Select all
Debug "He said \"hello\" to her"
;Output is:
;He said "hello" to her
Code: Select all
Debug "He said\r\n \"hello\" to her"
;Outputs is:
;He said
;"hello" to her
Code: Select all
Debug "He said\r\n \"hello\" to \t her"
;Outputs is:
;He said
;"hello" to her
Code: Select all
Debug "He said\r\n \"hello\" to \t her \\r"
;Outputs is:
;He said
;"hello" to her \r
Code: Select all
Debug "He said\r\n \"hello\" to \t her \"
;Outputs is:
;He said
;"hello" to her \
However, PureBasic may benefit much more from a StringFormat() function that supports this,
thus letting normal strings remain such (and fast processing since it's just concatenation),
Thus:
Code: Select all
text$=StringFormat("He said\n\r \"hello\" to \t her \")
Code: Select all
text$="He said"+#CRLF$+" "+#DQUOTE$+''hello"+#DQUOTE$+" to "+Chr(9)+" her \"
Oh and StringFormat() is just a suggestion on what to call this function.