nodejs string handling

Here are some handy string handling functions that you can use with nodejs.

Here’s how to get your string length:

You’ll see the output is 3, the length of the string! Super easy.

If you want to play with the code right now, you can try our jsfiddle.

As you can see we also concatenated two strings in this example as well. Using “+” the plus, we added the words “string length: ” to the actual string length.

Next up, let’s get the md5 hash for a string.

First you’ll want to install the md5 package.

Easy enough. Next, lets create a file with the following code:

Questions