git.schokokeks.org
Repositories
Help
Report an Issue
fs-words.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
1b85fc9
Branches
Tags
develop-client_server
master
typescript
fs-words.git
source
helpers
string.ts
[mod] makefile
Christian Fraß
commited
1b85fc9
at 2021-03-03 23:53:00
string.ts
Blame
History
Raw
namespace helpers.string { /** */ export function coin ( template : string, arguments_ : {[key : string] : string}, open : string = "{{", close : string = "}}" ) : string { let result : string = template; for (let [key, value] of Object.entries(arguments_)) { const pattern : string = (open + key + close); result = result.replace(new RegExp(pattern, "g"), value); } return result; } export function pad_left ( subject : string, length : int, filler : string ) : string { let result : string = subject; while (result.length < length) { result = (filler + result); } return result; } }