string.format()

44 views
Skip to first unread message

Bruce Sherwood

unread,
Jun 24, 2015, 11:20:13 AM6/24/15
to rapyd...@googlegroups.com
In the file

https://github.com/BruceSherwood/glowscript/blob/master/lib/glow/api_misc.js

is a new function

String.prototype.format = function(args)

that adds to JavaScript strings the useful Python string.format() function (not yet active in GlowScript).

Perhaps this is a candidate to add to the RapydScript standard library?

Bruce Sherwood

unread,
Jun 26, 2015, 12:21:44 AM6/26/15
to rapyd...@googlegroups.com
I discovered a missing capability and fixed it. I believe that it now mimics all of the features of Python text formatting..

Bruce Sherwood

unread,
Jun 26, 2015, 3:33:23 PM6/26/15
to rapyd...@googlegroups.com
And string.format() is now active in GlowScript (glowscript.org).

Alexander Tsepkov

unread,
Jun 26, 2015, 4:12:26 PM6/26/15
to Bruce Sherwood, RapydScript
Hey Bruce, thanks! Will definitely add this to stdlib.
Reply all
Reply to author
Forward
0 new messages