String.js is a lightweight open source JavaScript library that provides us with useful functions for working with strings.
You can easily download the String.js library code browsing in GitHub at https://github.com/jprichardson/string.js. The string.js library adds the S property to the window global object. The following code sample shows how simple it is to use this library.
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/html"> <head> <title>string.js demo</title> <script src="string.min.js"></script> </head> <body> <script type="text/javascript"> var bookName = S('<book>core scala</book>').between('<book>', '</book>').s; document.write(bookName); </script> </body> </html>
The following video clip overviews this code sample, shows its execution and explains it.
You can find more video clips and training material for learning how to use this library in my free online courses website at http://www.abelski.com.