xxxxxxxxxx
var str = "Hello, world 123!";
var regex = /[^0-9]/g; // only count letters
console.log(str.replace(regex, "").length); // replaces numbers to empty char and counts length
// prints 10 to the console
xxxxxxxxxx
console.log(("str1,str2,str3,str4".match(/,/g) || []).length); //logs 3
console.log(("str1,str2,str3,str4".match(new RegExp("str", "g")) || []).length); //logs 4
xxxxxxxxxx
//when use length for string this will be return the count of charactor
//in string
$("#about_me_textarea").val().length
xxxxxxxxxx
const str = "Hello World";
const characterCount = str.length;
console.log(characterCount);
xxxxxxxxxx
<application
…
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
…>
</application>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background" />
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
</adaptive-icon>
xxxxxxxxxx
// this take a Object named person, that defines property names and then config it to false
Object.defineProperty(person, "name", { configurable: false });