Skip to content
Snippets Groups Projects
Commit 72a22f2d authored by michael.minelli's avatar michael.minelli
Browse files

Toolbox => Add str to bool function

parent 700353e0
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,11 @@ class Toolbox { ...@@ -11,6 +11,11 @@ class Toolbox {
return Toolbox._instance; return Toolbox._instance;
} }
public strToBool(str: string): boolean {
str = str.toLowerCase().trim();
return str === 'true' || str === '1';
}
public randomString(length: number) { public randomString(length: number) {
let result = ''; let result = '';
let characters = 'abcdefghjklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789'; let characters = 'abcdefghjklmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment