The Official Blog of Patcoola

Im just a dude watching over my parents,
and trying to make cartoons and video games from home.

Script: Super Trim [JS]

Important!

Dear visitors,

This blog and the Tigarus.com network will be changing our website software in May (2024). There will be some down time and there will be a change to the webpage addresses.

We will also be removing the Anime blogs. The Rocksmith Songs website will be unavailable of a few weeks or months while I move the database to the new software.

At the moment we are running on Wordpress, the new software is an in-house project which is 57 times faster. It will also provide more freedom for development.

Thank you for understanding.

, By Patcoola

Script Title: superTrim
Programming Language: Java Script
Date Completed: 2012/11/26

Purpose: A Trim function that includes the inner contents of the text. Removes unwanted repeating spaces and white spaces.

Advertisement

Donate Now!

This might not be the best time, but making a blog is not easy. Would you consider donating?


Description: Removes spaces and white spaces from the beginning and end of a string value, also removes repeated spaces and white spaces from the inner body of text. Returns a string, if the input is not a valid string the value is returned.

Method:

superTrim ( string_s );

Example Usage:

var myText = “ Hello\t\t my name is Sam.”;

document.write( superTrim ( myText ) );

Returns Hello\t my name is Sam.
Note: \t is the code for tab space

 

Advertisement

Donate Now!

This might not be the best time, but making a blog is not easy. Would you consider donating?


 

Post Meta

Share Post

 

Comments: Write Comment

Be the first to write a comment.


Leave a Comment


All comments are reviewed before publishing. Comments must be related to the page topic, must not be spam, and must comply with the criminal code of Canada.

 
10.782909 milliseconds