Sign In Register

How can we help you today?

Start a new topic
Answered

Formatted string

Is there any way to use formatted string in Spark.setScriptData like ("matchId {0}", Spark.matchId) ?


Best Answer
since Cloud Code uses JavaScript, you can just implement it yoursself (JavaScript does not have a String.format function out of the box). And then use something like var formattedString = String.format("matchId {0}", Spark.matchId} See for example: http://stackoverflow.com/questions/610406/javascript-equivalent-to-printf-string-format
1 Comment

Answer
since Cloud Code uses JavaScript, you can just implement it yoursself (JavaScript does not have a String.format function out of the box). And then use something like var formattedString = String.format("matchId {0}", Spark.matchId} See for example: http://stackoverflow.com/questions/610406/javascript-equivalent-to-printf-string-format
Login to post a comment