For whatever reason JavaScript doesn’t include a trim method natively. This means that one of the first tasks for anyone doing any type of string processing (especially form validation) in JavaScript is to write a trim() method (or use a framework that provides one). The two following functions are supposed to be very fast: 1 [...]
Javascript: Inserting Thousand Separators
This post contains a simple JavaScript function for numerical formatting. It formats decimal numbers by inserting separator characters at the thousands positions. For example, 1234512345.12345 becomes 1,234,512,345.12345. You can also specify other separator and decimal point characters to suit your culture.
JavaScript: String Replace All
The JavaScript function for String Replace replaces the first occurrence in the string. The function is similar to the php function str_replace and takes two simple parameters. The first parameter is the pattern to find and the second parameter is the string to replace the pattern with when found. The javascript function does not Replace [...]
Useful PHP Regular Expression
In computing, regular expressions, also referred to as regex or regexp, provide a concise and flexible means for matching strings of text, such as particular characters, words, or patterns of characters. A regular expression is written in a formal language that can be interpreted by a regular expression processor, a program that either serves as [...]
Sprache mit JavaScript aus URL lesen
Mit dem folgenden RegEx befehl kann die Sprache aus der Url per Javascript ermittelt werden. Z.B. wird aus der Url http://onyou.ch/DE/Impressum das Sprachzeichen DE herausgelesen.
RegEx mit Javascript
Regular Expressions, kurz auch RE, RegEx oder RegExp genannt, sind ein extrem mächtiges Werkzeug, das in fast allen Programmiersprachen implementiert ist (auch in Javascript). RegEx sind eine Sammlung von Ausdrücken, mit denen man Suchmuster erstellen kann. Sie stellen erstens eine Art Filterkriterum für Texte dar. So ist es z.B. möglich alle Wörter die mit A [...]