In python I can do following
print "%02d:%02d" % (9, 6) # will output 09:06
How can I do this in TypeScript?
In python I can do following
print "%02d:%02d" % (9, 6) # will output 09:06
How can I do this in TypeScript?
Use the sprintf-js library and types.
FIDDLE: https://jsfiddle.net/1ytxfcwx/
NPM: https://www.npmjs.com/package/typescript-string-operations
GITHUB: https://github.com/sevensc/typescript-string-operations
Either use Template Strings -> https://basarat.gitbooks.io/typescript/content/docs/template-strings.html
or you can use a class a wrote -> String.Format not work in TypeScript
or use my NPM package!
https://www.npmjs.com/package/typescript-string-operations
var value = String.Format("{0:L}", "APPLE"); //output "apple"
© 2022 - 2024 — McMap. All rights reserved.