Last active
February 24, 2022 07:26
-
-
Save sonichandni/06e891a752b382d2da033c87307f1fc1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// find sub string | |
const string = "foo"; | |
const substring = "oo"; | |
console.log(string.includes(substring)); // true | |
// replace string | |
let text = "Visit Microsoft!"; | |
let result = text.replace("Microsoft", "W3Schools"); | |
//regex for height | |
var regex = /\d\'\d\'\'/; //Example: 5'7'' | |
var regex1 = /\d\'\d\d\'\'/; //Example: 5'11'' | |
if (regex.test(height) === true || regex1.test(height) === true ) { | |
new_height = height; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment