javascript right trim
function rtrim(str, ch)
{
for (i = str.length - 1; i >= 0; i--)
{
if (ch != str.charAt(i))
{
str = str.substring(0, i + 1);
break;
}
}
return str;
}//use trim() on your string. It removes first and last whitepsaces
let str = " aa bb ";
console.log(str.trim()); // "aa bb"
Also in JavaScript:
- change value of drop down using jquery
- is undefined javascript
- node silent print to themral
- js date methods
- javascript remove event listener
- create react app in existing folder
- moment get week day
- nodejs make directory
- moment.set
- comment jsx code
- how to send a command in js
- javascript is undefined
- javascript clear text in textarea
- add option to select jquery
- rawer icon dont opne
- Jquery SEND TO START OF ARRAY
- comment in vue js
- how to add json data to xmlhttprequest
- convert int to float in javascript
- duplicate encoder
- tinymce count characters
- If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project. That will permanently disable this message but you might encounter other issues.
- import dropdown react
- what is es11