[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/justJavaScript/jString.js/master/README.md [Back]  [Original]

jString.js
==========

jString is a javascript library extending String object with frequently needed methods.

Read more @ [hmkcode.com](http://hmkcode.com/jstring-js-light-javascript-string-library/).


### How to Include jString.js in your HTML File

* Download the jstring.js

* Add it in the HTML file

``

* Congratulations! your String has more methods

### jString.js Methods

##### ( 1 ) String.contains()

`"normal string".contains("t") \\ return true`

##### ( 2 ) String.count()

`"normal text".count("t"); \\ return 2`

##### ( 3 ) String.capitalize()

`"normal TEXT".capitalize(); \\ return "Normal text"`

##### ( 4 ) String.trim()

`" normal text ".trim(); \\ return "normal text"`

##### ( 5 ) String.leftTrim()

`" normal text".leftTrim(); \\ return "normal text"`

##### ( 6 ) String.rightTrim()

`"normal text ".rightTrim(); \\ return "normal text"`

##### ( 7 ) String.clear()

clear: will trim() + remove (+1) white-spaces in between

`" normal    text ".clear(); \\ return "normal text"`

##### ( 8 ) String.startsWith()

`"normal text".startsWith("nor"); \\ return true`

##### ( 9 ) String.endsWith()

`"normal text".endsWith("ext"); \\ return true`

##### ( 10 ) String.insert()

`"normal text".insert("X", 4); \\ return "normXal text"`

Web Proxy Viewer  |  New URL  |  Original Page