Win an Ipad
  Developer   Documents   String

String

This article explains how data type String is implemented in Moscrif.

String

String is a collection of a set of characters that can also contain spaces and numbers. Programmers in Moscrif must enclose strings in quotation marks for the data to be recognised as a string and not a number or variable name.

Example of how to define a String and obtain String size:

var str = "Example of the string data"; console << (str.length) << "\n"; //str lenght equlas 26

In comparison,  String.toNumber is used to compare value where data type is integer or float.

For type comparison, we use triple equals:

var str = "1234" console << "(str == 1234)=" << (str == 1234) << "\n"            // true
console << "(str === 1234)=" << (str === 1234) << "\n"          // false
console << "(str == \"1234\")=" << (str == "1234") << "\n"      // true
console << "(str === \"1234\")=" << (str === "1234") << "\n"    // true  

 Array   String   Regular Expressions 
Write a Comment (0)
Subject
Please complete this mandatory field.
HTML Tags Not Allowed!
Comment
Please complete this mandatory field.