StringAggregateΒΆ
aggcat.spad line 2529 [edit on github]
A string aggregate is a category for strings, that is, one dimensional arrays of characters.
- #: % -> NonNegativeInteger
from Aggregate
- <=: (%, %) -> Boolean
from PartialOrder
- <: (%, %) -> Boolean
from PartialOrder
- >=: (%, %) -> Boolean
from PartialOrder
- >: (%, %) -> Boolean
from PartialOrder
- coerce: % -> OutputForm
from CoercibleTo OutputForm
- coerce: Character -> %
coerce(c)
returnsc
as a strings
with the characterc
.
- concat: (%, %) -> %
from LinearAggregate Character
- concat: (%, Character) -> %
from LinearAggregate Character
- concat: (Character, %) -> %
from LinearAggregate Character
- concat: List % -> %
from LinearAggregate Character
- construct: List Character -> %
from Collection Character
- convert: % -> InputForm
from ConvertibleTo InputForm
- copyInto!: (%, %, Integer) -> %
from LinearAggregate Character
- count: (Character -> Boolean, %) -> NonNegativeInteger
- count: (Character, %) -> NonNegativeInteger
- delete: (%, Integer) -> %
from LinearAggregate Character
- delete: (%, UniversalSegment Integer) -> %
from LinearAggregate Character
- elt: (%, %) -> %
elt(s, t)
returns the concatenation ofs
andt
. It is provided to allow juxtaposition of strings to work as concatenation. For example,"smoo" "shed"
returns"smooshed"
.- elt: (%, Integer) -> Character
- elt: (%, Integer, Character) -> Character
from EltableAggregate(Integer, Character)
- elt: (%, UniversalSegment Integer) -> %
from Eltable(UniversalSegment Integer, %)
- eval: (%, Character, Character) -> % if Character has Evalable Character
from InnerEvalable(Character, Character)
- eval: (%, Equation Character) -> % if Character has Evalable Character
- eval: (%, List Character, List Character) -> % if Character has Evalable Character
from InnerEvalable(Character, Character)
- eval: (%, List Equation Character) -> % if Character has Evalable Character
- fill!: (%, Character) -> %
from IndexedAggregate(Integer, Character)
- first: % -> Character
from IndexedAggregate(Integer, Character)
- first: (%, NonNegativeInteger) -> %
from LinearAggregate Character
- hash: % -> SingleInteger
from Hashable
- hashUpdate!: (HashState, %) -> HashState
from Hashable
- insert: (%, %, Integer) -> %
from LinearAggregate Character
- insert: (Character, %, Integer) -> %
from LinearAggregate Character
- latex: % -> String
from SetCategory
- leftTrim: (%, Character) -> %
from LinearAggregate Character
- leftTrim: (%, CharacterClass) -> %
leftTrim(s, cc)
returnss
with all leading characters incc
deleted. For example,leftTrim("(abc)", charClass "()")
returns"abc)"
.
- less?: (%, NonNegativeInteger) -> Boolean
from Aggregate
- lowerCase!: % -> %
lowerCase!(s)
destructively replaces the alphabetic characters ins
by lower case.
- lowerCase: % -> %
lowerCase(s)
returns the string with all characters in lower case.
- map: ((Character, Character) -> Character, %, %) -> %
from LinearAggregate Character
- map: (Character -> Character, %) -> %
- match?: (%, %, Character) -> Boolean
match?(s, t, c)
tests ifs
matchest
except perhaps for multiple and consecutive occurrences of characterc
. Typicallyc
is the blank character.
- max: % -> Character
- max: (%, %) -> %
from OrderedSet
- max: ((Character, Character) -> Boolean, %) -> Character
- maxIndex: % -> Integer
from IndexedAggregate(Integer, Character)
- merge: (%, %) -> %
from LinearAggregate Character
- merge: ((Character, Character) -> Boolean, %, %) -> %
from LinearAggregate Character
- min: % -> Character
- min: (%, %) -> %
from OrderedSet
- minIndex: % -> Integer
from IndexedAggregate(Integer, Character)
- more?: (%, NonNegativeInteger) -> Boolean
from Aggregate
- new: (NonNegativeInteger, Character) -> %
from LinearAggregate Character
- position: (%, %, Integer) -> Integer
position(s, t, i)
returns the positionj
of the substrings
in stringt
, beginning at indexi
. ReturnsminIndex(s) - 1
if there is no suchj
.- position: (Character -> Boolean, %) -> Integer
from LinearAggregate Character
- position: (Character, %) -> Integer
from LinearAggregate Character
- position: (Character, %, Integer) -> Integer
from LinearAggregate Character
- position: (CharacterClass, %, Integer) -> Integer
position(cc, t, i)
returns the positionj
in stringt
of the first character belonging tocc
, beginning at indexi
. ReturnsminIndex(t) - 1
if there is no suchj
.
- prefix?: (%, %) -> Boolean
prefix?(s, t)
tests if the strings
is the initial substring oft
. Note:prefix?(s, t) = reduce(and, [s.i = t.i for i in indices s])
.
- reduce: ((Character, Character) -> Character, %) -> Character
from Collection Character
- reduce: ((Character, Character) -> Character, %, Character) -> Character
from Collection Character
- reduce: ((Character, Character) -> Character, %, Character, Character) -> Character
from Collection Character
- remove: (Character -> Boolean, %) -> %
from Collection Character
- remove: (Character, %) -> %
from Collection Character
- removeDuplicates: % -> %
from Collection Character
- replace: (%, UniversalSegment Integer, %) -> %
replace(s, i..j, t)
replaces the substrings(i..j)
ofs
by stringt
.
- reverse!: % -> %
from LinearAggregate Character
- reverse: % -> %
from LinearAggregate Character
- rightTrim: (%, Character) -> %
from LinearAggregate Character
- rightTrim: (%, CharacterClass) -> %
rightTrim(s, cc)
returnss
with all trailing occurrences of characters incc
deleted. For example,rightTrim("(abc)", charClass "()")
returns"(abc"
.
- select: (Character -> Boolean, %) -> %
from Collection Character
- setelt!: (%, Integer, Character) -> Character
from EltableAggregate(Integer, Character)
- setelt!: (%, UniversalSegment Integer, Character) -> Character
from LinearAggregate Character
- size?: (%, NonNegativeInteger) -> Boolean
from Aggregate
- smaller?: (%, %) -> Boolean
from Comparable
- sort!: % -> %
from LinearAggregate Character
- sort!: ((Character, Character) -> Boolean, %) -> %
from LinearAggregate Character
- sort: % -> %
from LinearAggregate Character
- sort: ((Character, Character) -> Boolean, %) -> %
from LinearAggregate Character
- sorted?: % -> Boolean
from LinearAggregate Character
- sorted?: ((Character, Character) -> Boolean, %) -> Boolean
from LinearAggregate Character
- split: (%, CharacterClass) -> List %
split(s, cc)
returns a list of substrings delimited by characters incc
.
- substring?: (%, %, Integer) -> Boolean
substring?(s, t, i)
tests ifs
is a substring oft
beginning at indexi
. Note:substring?(s, t, 0) = prefix?(s, t)
.
- suffix?: (%, %) -> Boolean
suffix?(s, t)
tests if the strings
is the final substring oft
. Note:suffix?(s, t) = reduce(and, [s.i = t.(n - m + i) for i indices s])
wherem
andn
denote the maxIndex ofs
andt
respectively.
- trim: (%, Character) -> %
from LinearAggregate Character
- trim: (%, CharacterClass) -> %
trim(s, cc)
returnss
with all characters incc
deleted from right and left ends. For example,trim("(abc)", charClass "()")
returns"abc"
.
- upperCase!: % -> %
upperCase!(s)
destructively replaces the alphabetic characters ins
by corresponding upper case characters.
- upperCase: % -> %
upperCase(s)
returns the string with all characters in upper case.
Eltable(UniversalSegment Integer, %)
EltableAggregate(Integer, Character)
Evalable Character if Character has Evalable Character
FiniteLinearAggregate Character
HomogeneousAggregate Character
IndexedAggregate(Integer, Character)
InnerEvalable(Character, Character) if Character has Evalable Character