Es.format
From EventScripts Community Encyclopedia
[edit] Method: formatModule: es [edit] Method Overview[edit] Table of Contents
[edit] Description
Formats a string according to the format-string and stores it into the variable command. [edit] Arguments<variable> <format-string> [token1] [token2] [token3] [...] [token9]
[edit] Examples# es.format es.set('mystring', '') es.set('myvar1', 'love') es.set('myvar2', 'EventScripts') es.format('mystring', 'Dont you just %1 %2?', str(es.ServerVar('myvar1')), str(es.ServerVar('myvar2'))) es.msg(str(es.ServerVar('mystring')) # Outputs: Dont you just love EventScripts? # Native string formatting in python: myvar1 = 'love' myvar2 = 'EventScripts' mystring = 'Dont you just %s %s?'%(myvar1, myvar2) es.msg(mystring) # Outputs: Dont you just love EventScripts? [edit] NotesThis is depreciated in favour of native python string formatting (see above for example/comparison) [edit] See Also |
|
