JavaScript String Reference

JavaScript Strings A JavaScript string stores a series of characters like “John Doe”. A string can be any text inside double or single quotes: var carname = “Volvo XC60”; var carname = ‘Volvo XC60’; String indexes are zero-based: The first character is in position 0, the second in 1, and so on. For a tutorial about Strings, read our JavaScript […]

SPSS Transformation Commands

Summary SPSS transformation commands (or simply “transformations”) can be loosely defined as commands that are not immediately carried out when you run them. Instead, they are kept in mind by SPSS and executed only when necessary. The table below gives an overview of SPSS’ main tranformation commands. Main SPSS Tranformation Commands COMMAND NAME GOAL TYPICAL USAGE […]

Substring (General Concept)

A substring is a subset of characters from a string. Extracting substrings in SPSS is done with CHAR.SUBSTR (SPSS versions 16+) or just SUBSTR (SPSS versions 15-). CHAR.SUBSTR takes two or three arguments as shown by the minimal example below. SPSS CHAR.SUBSTR – Minimal Example COMPUTE var_2 = CHAR.SUBSTR(var_1,3,2). The three arguments mean the following: var_1 denotes the variable […]

JavaScript String Methods

String methods help you to work with strings. String Methods and Properties Primitive values, like “John Doe”, cannot have properties or methods (because they are not objects). But with JavaScript, methods and properties are also available to primitive values, because JavaScript treats primitive values as objects when executing methods and properties. String Length The length property returns […]

JavaScript Strings

JavaScript strings are used for storing and manipulating text. JavaScript Strings A JavaScript string is zero or more characters written inside quotes. Example var answer = “It’s alright”; var answer = “He is called ‘Johnny’”; var answer = ‘He is called “Johnny”‘; Try it Yourself » String Length The length of a string is found in the built in property length: Example […]