Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
jos 2016-11-08 22:03:12 +01:00
commit 50553380c7

View File

@ -391,6 +391,11 @@ a string can be retrieved or replaced by using indexes. Strings can be converted
to a number using function `number`, and numbers can be converted to a string
using function `string`.
When setting the value of a character in a string, the character that has been
set is returned. Likewise, when a range of characters is set, that range of
characters is returned.
```js
var parser = math.parser();
@ -399,10 +404,11 @@ parser.eval('"hello"'); // String, "hello"
// string manipulation
parser.eval('a = concat("hello", " world")'); // String, "hello world"
parser.eval('size(a)'); // Number, 11
parser.eval('size(a)'); // Matrix [11]
parser.eval('a[1:5]'); // String, "hello"
parser.eval('a[1] = "H"'); // String, "Hello"
parser.eval('a[7:12] = "there!"'); // String, "Hello there!"
parser.eval('a[1] = "H"'); // String, "H"
parser.eval('a[7:12] = "there!"'); // String, "there!"
parser.eval('a'); // String, "Hello there!"
// string conversion
parser.eval('number("300")'); // Number, 300