String functions to find Contains and to Replace in Javascript
Below I described two string javascript functions that I often forget.
"If string Contains" in Javascript you can determine using "indexOf()" command.
var test = 'Hello World';
if( test.indexOf('World') >= 0){
alert('Found world');
}
If substring is not found, the result is -1. That’s why it’s better to compare with "-1":
if(test.indexOf('World') = -1){
alert('Found world');
}
To replace substring you should use String.Replace command. The syntax to replace the word "World" to nothing ('') is like this:
var test = 'Hello World';
newtest = test.Replace('World', '');
alert(newtest);
The result is "Hello ".
Custom Label with multiple styles in TextField of Fluent UI
First impressions after using the new SPFX 1.22.2 with Heft
Changing the Runtime Environment for an Azure App Service