LisaacTM Platform

ABSTRACT_STRING


Generic prototype for STRING and STRING_CONSTANT
Inherit/Insert Summary
parent_hashable No developed.
parent_comparable No developed.
 
Slot Summary
storage
Collection containing characters
count
size
lower
upper
size
capacity
size
 
Access.
item
Character at position index.
Infix '@'
Character at position index.
 
Switch case :
when then
When Self equal value, execute block
when or then
When Self equal value1 or value2, execute block
case then

See:
when_then
case_if then
If test is true then block
case_else
otherwise, execute block
 
Testing.
valid_index
True when index is valid (i.e., inside actual bounds).
is_empty
hash_code
Return a hashcode The hash-code value of Current.
Infix '<'
Is self strictly less than other?
Infix '~>'
Infix '~<'
Is Current less than other ?
Infix '!<'
Is Current less than other ? But, the upper to lower comparaison
compare
Compare alphabetically Self to other If current object equal to other, 0; if smaller, -1; if greater, 1.
same_as
Case insensitive ==.
Infix '=='
Has Current the same text as other ?
Infix '~='
Has Current the same text as other ?
item_code
Code of character at position i.
index_of since
Index of first occurrence of c at or after start_index, result = count + 1, if none.
last_index_of since
Index of first occurrence of c at or before start_index, 0 if none.
fast_index_of
Gives the index of the first occurrence ch or 0 if none.
index_of
Gives the index of the first occurrence of 'ch' or 0 if none.
first_index_of
Index of first occurrence of c at index 1 or after index 1.
fast_last_index_of
Gives the index of the last occurrence ch or 0 if none.
last_index_of
Index of last occurrence of c at index upper or before index upper.
first_difference_index
First difference index with other. if other is equal Self, return upper + 1
has
True if ch is in the STRING.
has_substring
True if other is in the STRING.
occurrences
Number of times character c appears in the string.
has_suffix
True if suffix of Current is s.
has_prefix
True if prefix of Current is p.
 
Testing and Conversion:
is_boolean
does self represent a BOOLEAN? valid BOOLEANS are "TRUE" and "FALSE".
to_boolean
Boolean value; "true" yields true, "false" yields false (what a surprise).
is_bit
True when the contents is a sequence of bits (i.e., mixed characters 0 and characters 1).
is_integer
Does self represent an INTEGER? Result is true if and only if the following two conditions hold:
1. In the following BNF grammar, the value of self can be produced by "Integer_literal", if leading and trailing separators are ignored:
Integer_literal = [Sign] Integer Sign = "+" | "-" Integer = Digit | Digit Integer Digit = "0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"
2. The numerical value represented by self is within the range that can be represented by an instance of type INTEGER.
is_integer_64
Does self represent an INTEGER_64? Result is true if and only if the following two conditions hold:
1. In the following BNF grammar, the value of self can be produced by "Integer_literal", if leading and trailing separators are ignored:
Integer_literal = [Sign] Integer Sign = "+" | "-" Integer = Digit | Digit Integer Digit = "0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"
2. The numerical value represented by self is within the range that can be represented by an instance of type INTEGER_64.
to_integer
self must look like an INTEGER.
to_integer_64
self must look like an INTEGER.
is_hexadecimal
to_hexadecimal
is_octal
to_octal
is_binary
to_binary
is_real_16_16
Does self represent an REAl_16_16 ? Result is true if and only if the following two conditions hold:
1. In the following BNF grammar, the value of self can be produced by "real_literal", if leading and trailing separators are ignored:
Real_literal = [Sign] Integer [Point Integer] Sign = "+" | "-" Point = "." Integer = Digit | Digit Integer Digit = "0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"
2. The numerical value represented by self is within the range that can be represented by an instance of type REAL_16_16.
to_real_16_16
 
Modification:
Infix '+'
Create a new STRING which is the concatenation of self and other.
as_lower
New object with all letters in lower case.
as_upper
New object with all letters in upper case.
 
Other features:
first
Access to the very first character.
last
Access to the very last character.
substring to
New string consisting of items [start_index.. end_index].
substring_begin to_begin
substring_begin to_end
substring_end to_end
substring_index
Position of the first occurrence of other at or after 1 or 0 f none.
first_substring_index
Position of the first occurrence of other at or after 1 or 0 if none.
 
Splitting a STRING:
partition from
partition
split_str
split_str in
Same jobs as split_str but result is appended in words.
split
Split the string into an array of words. Uses is_separator of CHARACTER to find words. Gives Void or a non empty array.
split_in
Same jobs as split but result is appended in words.
is_upper
True, if all characters is_upper or '_' or digit.
split_at
Split the string at characters c into an array of words.
split_at in
Same jobs as split but result is appended in words.
same_string
Do self and other have the same character sequence? Useful in proper descendants of STRING.
to_string
New STRING having the same character sequence as self. Useful in proper descendants of STRING.
to_abstract_string
string_buffer
Private, temporary once buffer.
split_buffer
 
Display.
print
printline
fast_print
println
 
The guru section
to_external
Gives C access to the internal storage (may be dangerous). To be compatible with C, a null character is added at the end of the internal storage. This extra null character is not part of the Lisaac STRING.
 

Inherit/Insert Detail

parent_hashable

.../base/string/abstract_string.li line #13

Section:
Inherit

Profile:
- SelfSELFparent_hashable : HASHABLE

parent_comparable

.../base/string/abstract_string.li line #15

Section:
Inherit

Profile:
- SelfSELFparent_comparable : COMPARABLE

Detail slot

storage

.../base/string/abstract_string.li line #19

Section:
Public

Profile:
+ SelfSELFstorage : NATIVE_ARRAYCHARACTER)

Description:
Collection containing characters

count

.../base/string/abstract_string.li line #24

Section:
Public

Profile:
+ SelfSELFcount : INTEGER

Description:
size

lower

.../base/string/abstract_string.li line #27

Section:
Public

Profile:
- SelfSELFlower : INTEGER

upper

.../base/string/abstract_string.li line #29

Section:
Public

Profile:
- SelfSELFupper : INTEGER

Description:
size

capacity

.../base/string/abstract_string.li line #32

Section:
Public

Profile:
- SelfSELFcapacity : INTEGER

Description:
size

Access.

item

.../base/string/abstract_string.li line #39

Section:
Public

Profile:
- SelfSELFitem   index : INTEGERCHARACTER

Description:
Character at position index.

Require:
index is valid

Infix '@'

.../base/string/abstract_string.li line #49

Section:
Public

Profile:
- SelfSELF@ ' Left 1  index : INTEGERCHARACTER

Description:
Character at position index.

Switch case :

when then

.../base/string/abstract_string.li line #59

Section:
Public

Profile:
- SelfSELFwhen   value : ABSTRACT_STRING  then   block :{}ABSTRACT_STRING

Description:
When Self equal value, execute block

when or then

.../base/string/abstract_string.li line #66

Section:
Public

Profile:
- SelfSELFwhen   value1 : ABSTRACT_STRING  or   value2 : ABSTRACT_STRING  then   block :{}ABSTRACT_STRING

Description:
When Self equal value1 or value2, execute block

case then

.../base/string/abstract_string.li line #73

Section:
Public

Profile:
- SelfSELFcase   value : ABSTRACT_STRING  then   block :{}ABSTRACT_STRING

See:
when_then

case_if then

.../base/string/abstract_string.li line #86

Section:
Public

Profile:
- SelfSELFcase_if   test :{ BOOLEAN}  then   block :{}ABSTRACT_STRING

Description:
If test is true then block

case_else

.../base/string/abstract_string.li line #99

Section:
Public

Profile:
- SelfSELFcase_else   block :{}

Description:
otherwise, execute block

Testing.

valid_index

.../base/string/abstract_string.li line #109

Section:
Public

Profile:
- SelfSELFvalid_index   index : INTEGERBOOLEAN

Description:
True when index is valid (i.e., inside actual bounds).

is_empty

.../base/string/abstract_string.li line #113

Section:
Public

Profile:
- SelfSELFis_empty : BOOLEAN

hash_code

.../base/string/abstract_string.li line #116

Section:
Public

Profile:
- SelfSELFhash_code : INTEGER

Description:
Return a hashcode The hash-code value of Current.

Infix '<'

.../base/string/abstract_string.li line #129

Section:
Public

Profile:
- SelfSELF< '  other : SELFBOOLEAN

Description:
Is self strictly less than other?

Infix '~>'

.../base/string/abstract_string.li line #131

Section:
Public

Profile:
- SelfSELF~> '  other : ABSTRACT_STRINGBOOLEAN

Infix '~<'

.../base/string/abstract_string.li line #133

Section:
Public

Profile:
- SelfSELF~< '  other : ABSTRACT_STRINGBOOLEAN

Description:
Is Current less than other ?

Infix '!<'

.../base/string/abstract_string.li line #154

Section:
Public

Profile:
- SelfSELF!< '  other : ABSTRACT_STRINGBOOLEAN

Description:
Is Current less than other ? But, the upper to lower comparaison

compare

.../base/string/abstract_string.li line #177

Section:
Public

Profile:
- SelfSELFcompare   other : ABSTRACT_STRINGINTEGER

Description:
Compare alphabetically Self to other If current object equal to other, 0; if smaller, -1; if greater, 1.

same_as

.../base/string/abstract_string.li line #206

Section:
Public

Profile:
- SelfSELFsame_as   other : ABSTRACT_STRINGBOOLEAN

Description:
Case insensitive ==.

Infix '=='

.../base/string/abstract_string.li line #231

Section:
Public

Profile:
- SelfSELF== ' Left 40  other : EBOOLEAN

Description:
Has Current the same text as other ?

Infix '~='

.../base/string/abstract_string.li line #238

Section:
Public

Profile:
- SelfSELF~= ' Left 40  other : ABSTRACT_STRINGBOOLEAN

Description:
Has Current the same text as other ?

item_code

.../base/string/abstract_string.li line #252

Section:
Public

Profile:
- SelfSELFitem_code   i : INTEGERINTEGER

Description:
Code of character at position i.

index_of since

.../base/string/abstract_string.li line #259

Section:
Public

Profile:
- SelfSELFindex_of   ch : CHARACTER  since   start_index : INTEGERINTEGER

Description:
Index of first occurrence of c at or after start_index, result = count + 1, if none.

last_index_of since

.../base/string/abstract_string.li line #274

Section:
Public

Profile:
- SelfSELFlast_index_of   ch : CHARACTER  since   start_index : INTEGERINTEGER

Description:
Index of first occurrence of c at or before start_index, 0 if none.

fast_index_of

.../base/string/abstract_string.li line #290

Section:
Public

Profile:
- SelfSELFfast_index_of   ch : CHARACTERINTEGER

Description:
Gives the index of the first occurrence ch or 0 if none.

index_of

.../base/string/abstract_string.li line #299

Section:
Public

Profile:
- SelfSELFindex_of   ch : CHARACTERINTEGER

Description:
Gives the index of the first occurrence of 'ch' or 0 if none.

first_index_of

.../base/string/abstract_string.li line #306

Section:
Public

Profile:
- SelfSELFfirst_index_of   c : CHARACTERINTEGER

Description:
Index of first occurrence of c at index 1 or after index 1.

fast_last_index_of

.../base/string/abstract_string.li line #312

Section:
Public

Profile:
- SelfSELFfast_last_index_of   ch : CHARACTERINTEGER

Description:
Gives the index of the last occurrence ch or 0 if none.

last_index_of

.../base/string/abstract_string.li line #322

Section:
Public

Profile:
- SelfSELFlast_index_of   c : CHARACTERINTEGER

Description:
Index of last occurrence of c at index upper or before index upper.

first_difference_index

.../base/string/abstract_string.li line #328

Section:
Public

Profile:
- SelfSELFfirst_difference_index   other : ABSTRACT_STRINGINTEGER

Description:
First difference index with other. if other is equal Self, return upper + 1

has

.../base/string/abstract_string.li line #349

Section:
Public

Profile:
- SelfSELFhas   ch : CHARACTERBOOLEAN

Description:
True if ch is in the STRING.

has_substring

.../base/string/abstract_string.li line #352

Section:
Public

Profile:
- SelfSELFhas_substring   other : ABSTRACT_STRINGBOOLEAN

Description:
True if other is in the STRING.

occurrences

.../base/string/abstract_string.li line #356

Section:
Public

Profile:
- SelfSELFoccurrences   c : CHARACTERINTEGER

Description:
Number of times character c appears in the string.

has_suffix

.../base/string/abstract_string.li line #362

Section:
Public

Profile:
- SelfSELFhas_suffix   s : ABSTRACT_STRINGBOOLEAN

Description:
True if suffix of Current is s.

has_prefix

.../base/string/abstract_string.li line #383

Section:
Public

Profile:
- SelfSELFhas_prefix   p : ABSTRACT_STRINGBOOLEAN

Description:
True if prefix of Current is p.

Testing and Conversion:

is_boolean

.../base/string/abstract_string.li line #403

Section:
Public

Profile:
- SelfSELFis_boolean : BOOLEAN

Description:
does self represent a BOOLEAN? valid BOOLEANS are "TRUE" and "FALSE".

to_boolean

.../base/string/abstract_string.li line #410

Section:
Public

Profile:
- SelfSELFto_boolean : BOOLEAN

Description:
Boolean value; "true" yields true, "false" yields false (what a surprise).

is_bit

.../base/string/abstract_string.li line #418

Section:
Public

Profile:
- SelfSELFis_bit : BOOLEAN

Description:
True when the contents is a sequence of bits (i.e., mixed characters 0 and characters 1).

is_integer

.../base/string/abstract_string.li line #433

Section:
Public

Profile:
- SelfSELFis_integer : BOOLEAN

Description:
Does self represent an INTEGER? Result is true if and only if the following two conditions hold:
1. In the following BNF grammar, the value of self can be produced by "Integer_literal", if leading and trailing separators are ignored:
Integer_literal = [Sign] Integer Sign = "+" | "-" Integer = Digit | Digit Integer Digit = "0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"
2. The numerical value represented by self is within the range that can be represented by an instance of type INTEGER.

is_integer_64

.../base/string/abstract_string.li line #519

Section:
Public

Profile:
- SelfSELFis_integer_64 : BOOLEAN

Description:
Does self represent an INTEGER_64? Result is true if and only if the following two conditions hold:
1. In the following BNF grammar, the value of self can be produced by "Integer_literal", if leading and trailing separators are ignored:
Integer_literal = [Sign] Integer Sign = "+" | "-" Integer = Digit | Digit Integer Digit = "0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"
2. The numerical value represented by self is within the range that can be represented by an instance of type INTEGER_64.

to_integer

.../base/string/abstract_string.li line #606

Section:
Public

Profile:
- SelfSELFto_integer : INTEGER

Description:
self must look like an INTEGER.

to_integer_64

.../base/string/abstract_string.li line #664

Section:
Public

Profile:
- SelfSELFto_integer_64 : INTEGER_64

Description:
self must look like an INTEGER.

is_hexadecimal

.../base/string/abstract_string.li line #722

Section:
Public

Profile:
- SelfSELFis_hexadecimal : BOOLEAN

to_hexadecimal

.../base/string/abstract_string.li line #735

Section:
Public

Profile:
- SelfSELFto_hexadecimal : INTEGER_64

is_octal

.../base/string/abstract_string.li line #744

Section:
Public

Profile:
- SelfSELFis_octal : BOOLEAN

to_octal

.../base/string/abstract_string.li line #757

Section:
Public

Profile:
- SelfSELFto_octal : INTEGER_64

is_binary

.../base/string/abstract_string.li line #767

Section:
Public

Profile:
- SelfSELFis_binary : BOOLEAN

to_binary

.../base/string/abstract_string.li line #783

Section:
Public

Profile:
- SelfSELFto_binary : INTEGER_64

is_real_16_16

.../base/string/abstract_string.li line #796

Section:
Public

Profile:
- SelfSELFis_real_16_16 : BOOLEAN

Description:
Does self represent an REAl_16_16 ? Result is true if and only if the following two conditions hold:
1. In the following BNF grammar, the value of self can be produced by "real_literal", if leading and trailing separators are ignored:
Real_literal = [Sign] Integer [Point Integer] Sign = "+" | "-" Point = "." Integer = Digit | Digit Integer Digit = "0"|"1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"
2. The numerical value represented by self is within the range that can be represented by an instance of type REAL_16_16.

to_real_16_16

.../base/string/abstract_string.li line #894

Section:
Public

Profile:
- SelfSELFto_real_16_16 : REAL_16_16

Modification:

Infix '+'

.../base/string/abstract_string.li line #969

Section:
Public

Profile:
- SelfSELF+ '  other : ABSTRACT_STRINGSTRING_BUFFER

Description:
Create a new STRING which is the concatenation of self and other.

as_lower

.../base/string/abstract_string.li line #985

Section:
Public

Profile:
- SelfSELFas_lower : STRING

Description:
New object with all letters in lower case.

as_upper

.../base/string/abstract_string.li line #995

Section:
Public

Profile:
- SelfSELFas_upper : STRING

Description:
New object with all letters in upper case.

Other features:

first

.../base/string/abstract_string.li line #1007

Section:
Public

Profile:
- SelfSELFfirst : CHARACTER

Description:
Access to the very first character.

last

.../base/string/abstract_string.li line #1019

Section:
Public

Profile:
- SelfSELFlast : CHARACTER

Description:
Access to the very last character.

substring to

.../base/string/abstract_string.li line #1031

Section:
Public

Profile:
- SelfSELFsubstring   start_index : INTEGER  to   end_index : INTEGERSTRING

Description:
New string consisting of items [start_index.. end_index].

substring_begin to_begin

.../base/string/abstract_string.li line #1053

Section:
Public

Profile:
- SelfSELFsubstring_begin   start : INTEGER  to_begin   end : INTEGERSTRING

substring_begin to_end

.../base/string/abstract_string.li line #1058

Section:
Public

Profile:
- SelfSELFsubstring_begin   start : INTEGER  to_end   end : INTEGERSTRING

substring_end to_end

.../base/string/abstract_string.li line #1063

Section:
Public

Profile:
- SelfSELFsubstring_end   start : INTEGER  to_end   end : INTEGERSTRING

substring_index

.../base/string/abstract_string.li line #1068

Section:
Public

Profile:
- SelfSELFsubstring_index  ( other : ABSTRACT_STRING, start_index : INTEGER) : INTEGER

Description:
Position of the first occurrence of other at or after 1 or 0 f none.

first_substring_index

.../base/string/abstract_string.li line #1093

Section:
Public

Profile:
- SelfSELFfirst_substring_index   other : ABSTRACT_STRINGINTEGER

Description:
Position of the first occurrence of other at or after 1 or 0 if none.

Splitting a STRING:

partition from

.../base/string/abstract_string.li line #1106

Section:
Public

Profile:
- SelfSELFpartition   sep : ABSTRACT_STRING  from   start_index : INTEGER :( STRINGSTRINGSTRING)

partition

.../base/string/abstract_string.li line #1131

Section:
Public

Profile:
- SelfSELFpartition   sep : ABSTRACT_STRING :( STRINGSTRINGSTRING)

split_str

.../base/string/abstract_string.li line #1136

Section:
Public

Profile:
- SelfSELFsplit_str   sep : ABSTRACT_STRINGARRAYSTRING)

split_str in

.../base/string/abstract_string.li line #1156

Section:
Public

Profile:
- SelfSELFsplit_str   sep : ABSTRACT_STRING  in   words : COLLECTIONSTRING)

Description:
Same jobs as split_str but result is appended in words.

split

.../base/string/abstract_string.li line #1175

Section:
Public

Profile:
- SelfSELFsplit : ARRAYSTRING)

Description:
Split the string into an array of words. Uses is_separator of CHARACTER to find words. Gives Void or a non empty array.

split_in

.../base/string/abstract_string.li line #1193

Section:
Public

Profile:
- SelfSELFsplit_in   words : COLLECTIONSTRING)

Description:
Same jobs as split but result is appended in words.

is_upper

.../base/string/abstract_string.li line #1229

Section:
Public

Profile:
- SelfSELFis_upper : BOOLEAN

Description:
True, if all characters is_upper or '_' or digit.

split_at

.../base/string/abstract_string.li line #1242

Section:
Public

Profile:
- SelfSELFsplit_at   sep : CHARACTERARRAYSTRING)

Description:
Split the string at characters c into an array of words.

split_at in

.../base/string/abstract_string.li line #1261

Section:
Public

Profile:
- SelfSELFsplit_at   sep : CHARACTER  in   words : COLLECTIONSTRING)

Description:
Same jobs as split but result is appended in words.

same_string

.../base/string/abstract_string.li line #1304

Section:
Public

Profile:
- SelfSELFsame_string   other : ABSTRACT_STRINGBOOLEAN

Description:
Do self and other have the same character sequence? Useful in proper descendants of STRING.

to_string

.../base/string/abstract_string.li line #1312

Section:
Public

Profile:
- SelfSELFto_string : STRING

Description:
New STRING having the same character sequence as self. Useful in proper descendants of STRING.

to_abstract_string

.../base/string/abstract_string.li line #1319

Section:
Public

Profile:
- SelfSELFto_abstract_string : ABSTRACT_STRING

string_buffer

.../base/string/abstract_string.li line #1321

Section:
Public

Profile:
- SelfSELFstring_buffer : STRING

Description:
Private, temporary once buffer.

split_buffer

.../base/string/abstract_string.li line #1323

Section:
Public

Profile:
- SelfSELFsplit_buffer : ARRAYSTRING)

Display.

print

.../base/string/abstract_string.li line #1329

Section:
Public

Profile:
- SelfSELFprint 

printline

.../base/string/abstract_string.li line #1335

Section:
Public

Profile:
- SelfSELFprintline 

fast_print

.../base/string/abstract_string.li line #1341

Section:
Public

Profile:
- SelfSELFfast_print 

println

.../base/string/abstract_string.li line #1346

Section:
Public

Profile:
- SelfSELFprintln 

The guru section

to_external

.../base/string/abstract_string.li line #1356

Section:
Public

Profile:
- SelfSELFto_external : NATIVE_ARRAYCHARACTER)

Description:
Gives C access to the internal storage (may be dangerous). To be compatible with C, a null character is added at the end of the internal storage. This extra null character is not part of the Lisaac STRING.