-
Notifications
You must be signed in to change notification settings - Fork 1
String (type)
String is an entity type used in PapajScript. It stores text strings.
String is the second entity type introduced in PS. Its debut was on April 26, 2018 along with release of the 0.4.0 version. The 0.4.2 version was the last version that treated all alphanumerical input as strings, unless it was not a pre-built function. Starting from version 0.4.3, the unknown input triggers an exception, unless quoted.
- All strings are quoted –
"This"
is String,this
is not. - Since May 5, 2020 all functions operating on strings are wrapped to a String package.
- The strings may be run as they were PS script. See
String.eval
(orString.run
in the pre-0.5.1 versions) in String package for more information. - Using
sort
on a set of strings sorts them by their size – thestrsort
is found since 0.4.3. - Since October 1, 2020 (stable version 0.5.1) the strings are zero-based and evaluated in C-like style by default (it may be changed by using a directive
@stringstart
)
String type supports following artithmetic operations:
-
String String +
(an equivalentString.join
orString.concat
) -
String String -
(an equivalent ofString.delete
) -
String Number -
(an equivalent ofString.delete
) -
Number String *
(an equivalent ofString.copies
) -
String Number *
(an equivalent ofString.copies
) -
String Number /
(an equivalent ofString.divide
) -
String String /
(an equivalent ofString.divide
)
Note: All arithmetical operations do not require any additional packages
"Hello world!"
"Shalom!"
"h"
Versions of Papaj:
Pre-builds: Bereshit (v.0.0.1), Shemot (v.0.0.2)
Aleph (v.0.1.0), Bet (v.0.2.0), Gimel (v.0.2.1), Dalet (v.0.3.0)
Hey (v.0.3.1), Vav (v.0.4.0), Zain (v.0.4.1), Chet (v.0.4.2), Tet (v.0.4.3)
Yod (v.0.5.0), Khaf (v.0.5.1), Lamed (v.0.5.2), Mem (v.0.5.3), Nun (v.0.5.4), Samech (v.0.5.5)
Development version: Leviathan
Packages of Papaj:
Vanilla, Array, Console, Date, Math, Number, String
Structures of Papaj:
Conditional, Entity, Loop, Variable
Array, Boolean, DateTime, Exception, LogicalExpression, Function, Number, Null, String
Home, PapajScript, Papaj (interpreter), Papaj REPL