Posts

Showing posts with the label string

javascript : String.toCharCodeArray()

  javascript : String .toCharCodeArray() Target: Applicable with  String  Data Type. Description : return array of object {char:character, code:charCode} of string's every characters. Syntax: String .toCharCodeArray() Usase: "Hello World".toCharCodeArray() It return Array [{"char":"H","code":72},{"char":"e","code":101},{"char":"l","code":108},{"char":"l","code":108},{"char":"o","code":111},{"char":" ","code":32},{"char":"W","code":87},{"char":"o","code":111},{"char":"r","code":114},{"char":"l","code":108},{"char":"d","code":100}] Download MYJS.js MyJs is a collection of java script extension methods that enhances the JavaScript objects, class ...

javascript : String.toCodeArray()

  javascript : String .toCodeArray() Target: Applicable with  String  Data Type. Description : return array of character Codes of string's every characters. Syntax: String .toCodeArray() Usase: "Hello World".toCodeArray() It return Array [72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100] "MyJs : Make your javascript coding easy.".toCodeArray() It return Array [77, 121, 74, 115, 32, 58, 32, 77, 97, 107, 101, 32, 121, 111, 117, 114, 32, 106, 97, 118, 97, 115, 99, 114, 105, 112, 116, 32, 99, 111, 100, 105, 110, 103, 32, 101, 97, 115, 121, 46] "MyJs : Make your javascript coding easy.".toCodeArray().distinct() It return Array [77, 121, 74, 115, 32, 58, 97, 107, 101, 111, 117, 114, 106, 118, 99, 105, 112, 116, 100, 110, 103, 46] "This library add many dom prototype extension methods to make javascript coding easy.".toCodeArray().forEach(x=>console.log(x)); It return in console 84 104 105 115 32 108 105 98 114 97 114 121 32 97 100 32 109 97 11...

javascript : String.toArray()

  javascript : String .toArray() Target: Applicable with  String  Data Type. Description : It convert string to characters array. Syntax: String .toArray() Usase: "Hello World".toArray() It return Array ["H", "e", "l", "l", "o", " ", "W", "o", "r", "l", "d"] "MyJs : Make your javascript coding easy.".toArray() It return Array ["M", "y", "J", "s", " ", ":", " ", "M", "a", "k", "e", " ", "y", "o", "u", "r", " ", "j", "a", "v", "a", "s", "c", "r", "i", "p", "t", " ", "c", "o", "d", "i", "n", "g", " ", "e", ...

javascript : Object.isNumber

  javascript : Object .isNumber Target: Applicable with any javascript  Object/String  Variable  that holds numeric value . Description : When an object holds an numeric value then it return  true  otherwise  undefined . basically it is defined in Number prototype. Many time in programming we face a problem that an object variable holds Numeric value or other object structure then it help us. Before writing the code of Numeric calculation we can check whether a variable holds Numeric value or not. Note: It is an property of Numeric, that is defined in Numeric Prototype. It is useful to check an object variable is Numeric or any other type. another way to check variable holds numeric value is "typeof(variable) = 'number'" but when variable holds string numeric value it return "typeof(variable) = 'string'" Syntax: Object .isNumber return  true  when object hold's Numeric value otherwise  undefined Usase: var obj = 55; console.log('typeof o...

javascript : String.parseFloat([nanValue])

  javascript : String .parseFloat( [nanValue] ) Target: Applicable with  String  Data Type. Description : convert string to floating point number. Syntax: String .parseFloat( [nanValue] ) Note : string is Not a Number then it return NaN or passed value (nanValue) Usase: "55.25".parseFloat() It return number 55.25 "132abcd".parseFloat() It return number 123 "1,23,456.789".parseFloat() It return number 1 "abcd132".parseFloat() It return number  NaN "abcd132".parseFloat(0) It return number  0 "abcd132".parseFloat(-1) It return number  -1 Download MYJS.js MyJs is a collection of java script extension methods that enhances the JavaScript objects, class object, DOM element, domElementsCollections, Date, String, Number and other data type.  Include in you project landing page (master page) and it will extends your DOM and JavaScript Objects.

javascript : String.parseInt([nanValue])

  javascript : String .parseInt( [nanValue] ) Target: Applicable with  String  Data Type. Description : convert string to number. Syntax: String .parseInt( [nanValue] ) Note : string is Not a Number then it return NaN or passed value (nanValue) Usase: "55.25".parseInt() It return number 55 "132abcd".parseInt() It return number 123 "1,23,456.789".parseInt() It return number 1 "abcd132".parseInt() It return number  NaN "abcd132".parseInt(0) It return number  0 "abcd132".parseInt(-1) It return number  -1 Download MYJS.js MyJs is a collection of java script extension methods that enhances the JavaScript objects, class object, DOM element, domElementsCollections, Date, String, Number and other data type.  Include in you project landing page (master page) and it will extends your DOM and JavaScript Objects.

javascript : String strColor.toRGBA()

  javascript : String strColor .toRGBA() Target: Applicable with  String  Data Type. Description : convert string color to object { } having attributes. r,g,b,a,value and hex. Note: return javascript object. { }.r = Red Value { }.g = Green Value { }.b = Blue Value { }.a = Alpha Value { }.value = rgba string { }.hex = Hexa color string Syntax: String .toRGBA() Usase: "red".toRGBA() It return object { r: 255, g: 0, b: 0, a: 1, value: "rgb(255, 0, 0)", hex : "#ff0000"} "lightblue".toRGBA() It return object { r: 173, g: 216, b: 230, a: 1, value: "rgb(173, 216, 230)", hex : "#add8e6"} "rgb(128,128,55)".toRGBA() It return object { r: 128, g: 128, b: 55, a: 1, value: "rgb(128, 128, 55)", hex : "#808037"} "rgba(255,128,60,0.6)".toRGBA() It return object { r: 255, g: 128, b: 60, a: 0.6, value: "rgba(255, 128, 60, 0.6)", hex : "#ff803c99"} "#2abcde".toRGBA() It return...

javascript : String.mid

  javascript : String .mid( n, m ) Target: Applicable with  String  Data Type. Description : return m number of charector from string starts from n. Syntax: String .mid( n, m ) Usase: "abcdefghijklmnopqrstuvwxyz".mid(7,5) It return string "hijkl" Download MYJS.js MyJs is a collection of java script extension methods that enhances the JavaScript objects, class object, DOM element, domElementsCollections, Date, String, Number and other data type.  Include in you project landing page (master page) and it will extends your DOM and JavaScript Objects.

javascript : String.right

  javascript : String .right( n ) Target: Applicable with  String  Data Type. Description : return last n number of charector from string. Syntax: String .right( n ) Usase: "abcdefghijklmnopqrstuvwxyz".right(7) It return string "tuvwxyz" Download MYJS.js MyJs is a collection of java script extension methods that enhances the JavaScript objects, class object, DOM element, domElementsCollections, Date, String, Number and other data type.  Include in you project landing page (master page) and it will extends your DOM and JavaScript Objects.

javascript : String.left

  javascript : String .left( n ) Target: Applicable with  String  Data Type. Description : return first n number of charector from string. Syntax: String .left( n ) Usase: "abcdefghijklmnopqrstuvwxyz".left(7) It return string "abcdefg" Download MYJS.js Include in you project landing page (master page) and it will extends your DOM and JavaScript Objects.

javascript : String.reverse()

  javascript : String .reverse() Target: Applicable with  String  Data Type. Description : Reverses the string letter by letter right to left. Syntax: String .reverse() Usase: " hello     how     are     you ? ".reverse() It return string " ? uoy     era     woh     olleh " "hello-how-are-you-?".reverse() It return string "?-uoy-era-woh-olleh" Download MYJS.js MyJs is a collection of java script extension methods that enhances the JavaScript objects, class object, DOM element, domElementsCollections, Date, String, Number and other data type.  Include in you project landing page (master page) and it will extends your DOM and JavaScript Objects.

javascript : Number.format(strFormat)

javascript : Number .format( strFormat ) Target: Applicable with  Number  Data Type. Description : format Number to string with given format string. Note: strFormat should to matched with regular Expression "/^([0#,])+([.]){0,1}([0])*$/" other wise return toLocalString(). Syntax: Number .format( strFormat ) Usase: (123456.123456).format("##,##,##0.00")  //Currency It return string "1,23,456.12" (123456.123456).format("00000000000")  //pad zero It return string "00000123456" (123456545).format("00000000000.00")  //pad zero + decimal It return string "00123456545.00" (123456545).format("0.00")  //Fixed Decimal Places It return string "123456545.00" (123456.545).format("0.00")  //floating point round in decimal places It return string "123456.55" Download MYJS.js MyJs is a collection of java script extension methods that enhances the JavaScript objects, class object, DOM element...

javascript : Date.addMinutes(number)

  javascript : Date .addMinutes( Number ) Target: Applicable with  Date  Data Type. Description : Add/Subtract Minutes from Date and return new Date object. Syntax: Date .addMinutes( number ) Usase: var dd = '1 Apr 2020 12:00 AM'.toDateTime(); dd.addMinutes(1); It return "Wed Apr 01 2020 00:01:00 GMT+0530 (India Standard Time)" dd.addMinutes(-1); It return "Tue Mar 31 2020 23:59:00 GMT+0530 (India Standard Time)" Download MYJS.js MyJs is a collection of java script extension methods that enhances the JavaScript objects, class object, DOM element, domElementsCollections, Date, String, Number and other data type.  Include in you project landing page (master page) and it will extends your DOM and JavaScript Objects.

javascript : String.toDate()

  javascript : String .toDate() Target: Applicable with  String  Data Type. Description : convert string to Date object. Date should be "dd-MMM-yyyy" or "dd-MM-yyyy" Note: In case of invalid date string it return "1-Jan-1900" Syntax: String .toDate() Usase: "11-Oct-2019".toDate() It return Date "Fri Oct 11 2019 00:00:00 GMT+0530 (India Standard Time)" "11/Oct/2019".toDate() It return Date "Fri Oct 11 2019 00:00:00 GMT+0530 (India Standard Time)" "11.Oct.2019".toDate() It return Date "Fri Oct 11 2019 00:00:00 GMT+0530 (India Standard Time)" "5Jun2019".toDate() It return Date "Wed Jun 05 2019 00:00:00 GMT+0530 (India Standard Time)" "15Jun".toDate() It return Date "Sat Jun 15 2019 00:00:00 GMT+0530 (India Standard Time)" "28, Jun".toDate() It return Date "Fri Jun 28 2019 00:00:00 GMT+0530 (India Standard Time)" "11, oct - 2019".to...

javascript : String.toNumber()

javascript : String .toNumber( [nanValue] ) Target: Applicable with  String  Data Type. Description : convert string to number. Syntax: String .toNumber( [nanValue] ) Note : string is NaN then it return (0) or passed value (nanValue) Usase: "55.25".toNumber() It return number 55.25 "10,500.50".toNumber() It return number 10500.5 "1,23,456.789".toNumber() It return number 123456.789 "132abcd".toNumber() It return number 123 "abcd132".toNumber() It return number 0 "abcd132".toNumber(-1) It return number -1 Download MYJS.js MyJs is a collection of java script extension methods that enhances the JavaScript objects, class object, DOM element, domElementsCollections, Date, String, Number and other data type.  Include in you project landing page (master page) and it will extends your DOM and JavaScript Objects.

javascript : String.toSnakeCase()

  javascript : String .toSnakeCase() Target: Applicable with  String  Data Type. Description : convert string to a single word in snake_case format. Every words separated by '_'. Note: convert into snake_case from PascalCase, camelCase and kebab-case. Syntax: String .toSnakeCase() Usase: " hello     how     are     you ? ".toSnakeCase() It return string "hello_how_are_you_?" "hello-how-are-you-?".toSnakeCase() It return string "hello_how_are_you_?" "helloHowAreYou?".toSnakeCase() It return string "hello_how_are_you_?" "HelloHowAreYou?".toSnakeCase() It return string "hello_how_are_you_?" Download MYJS.js Include in you project landing page (master page) and it will extends your DOM and JavaScript Objects.