sridhar-string-module
- In this Module Provide some of the String Operation's. We can do Some type of String operations with the help of this module
On Ubuntu/Debian:
sudo apt install npm nodejs
On Windows: npm install -g npm
Use Node to install from NPM Package Module
$ npm install <module name> --save
var sridhar-string-module = require('sridhar-string-module');
var slice_string = sridhar-math-module.slice_string(string,start_index,end_index);
console.log(slice_string);
var slice_string = sridhar-math-module.slice_string("hello world",1,4);
console.log(slice_string);
ello
var replace_string = sridhar-math-module.replace_string(string,start_index,end_index);
console.log(replace_string);
var replace_string = sridhar-math-module.replace_string("hello world","Hello World");
console.log(replace_string);
Hello World
var upper = sridhar-math-module.replace_all_string(string,start_index,end_index);
console.log(replace_all_string);
var replace_all_string = sridhar-math-module.replace_all_string("hello world","Hello World");
console.log(replace_all_string);
Hello World
var upper = sridhar-math-module.upper(string);
console.log(upper);
var upper = sridhar-math-module.upper("hello world");
console.log(upper);
HELLO WORLD
var lower = sridhar-math-module.lower(string);
console.log(lower);
var lower = sridhar-math-module.lower("HELLO WORLD");
console.log(lower);
hello world
var concat_string = sridhar-math-module.concat_string(string1,string2);
console.log(concat_string);
var concat_string = sridhar-math-module.concat_string("HELLO WORLD","I AM FROM INDIA");
console.log(concat_string);
HELLO WORLD I AM FROM INDIA
var trim = sridhar-math-module.trim(string);
console.log(trim);
var trim = sridhar-math-module.trim("HELLO WORLD ");
console.log(trim);
HELLOWORLD
var trimEnd = sridhar-math-module.trimEnd(string);
console.log(trimEnd);
var trimEnd = sridhar-math-module.trimEnd("HELLO WORLD ");
console.log(trimEnd);
HELLO WORLD
var spilt = sridhar-math-module.spilt(string,requirment);
console.log(spilt);
var spilt = sridhar-math-module.spilt("HELLO,WORLD",",");
console.log(spilt);
"HELLO" "WORLD"
var get_Index_element_string = sridhar-math-module.get_Index_element_string(string,index);
console.log(get_Index_element_string);
var get_Index_element_string = sridhar-math-module.get_Index_element_string("hello world",3);
console.log(get_Index_element_string);
l
"HELLO" "WORLD"
var capital_first_letter_each = sridhar-math-module.capital_first_letter_each(string);
console.log(capital_first_letter_each);
var capital_first_letter_each = sridhar-math-module.capital_first_letter_each("hello world");
console.log(capital_first_letter_each);
Hello World
var position_of_substring = sridhar-math-module.position_of_substring(string,substring);
console.log(position_of_substring);
var position_of_substring = sridhar-math-module.position_of_substring("hello world",world);
console.log(position_of_substring);
6