NeturalMath Language Definition and Syntax

String Data Type

The String data type is a representation of an arbirary chain of characters or textual data. It is a mechanism for representing text in the system. It is closely related to the .NET System.String data type, and is approximately equivalent to the {string} data type in C#.

Type information

The String data type will return the String {'string'} when queried.
:> x = 'this is a string'
:> numType = type(x)
:> print numType

'string'


If output, the string data type will return its literal value, surrounded by single quotes ({'})
:> x = 'this is a string'
:> print x

'this is a string'
:> y = 'this is another string'
:> print y

'this is another string'


Operations

This section is not complete

Literals

Literals are entered by keying in a sequence of characters surrounded by single quotes ({'}). If two single quotes are placed together ({''}), the value that is returned will be the empty string constant.
:> a = 'this is a string'
:> b = 'this is also a string'
:> c = 'one string, two string'
:> d = 'red string, blue string'
:> e = ''  // empty string constant

Conversions

Strings exhibit the following behaviors when converted to other types:

Bool

This section is not complete

Complex

This section is not complete

Number

This section is not complete

Range

This section is not complete

Set

This section is not complete

Units

This section is not complete

Functions

The following System Functions consume the String data type:
This section is not complete

See Also:

Last edited Oct 14, 2010 at 2:15 PM by zanethorn, version 2

Comments

No comments yet.