Useful API Functions: Unterschied zwischen den Versionen

Aus expecco Wiki (Version 2.x)
Zur Navigation springen Zur Suche springen
Zeile 1: Zeile 1:
This document lists most useful (and most often needed) functions.
This document lists most useful (and most often needed) classes and functions.
Be aware, that there are many more to be found in either the class references or via the builtin class browser.
Be aware, that there are many more to be found in either the class references or via the builtin class browser.


Zeile 9: Zeile 9:
==== Comparing ====
==== Comparing ====


''string1'' = ''string2''<br>&nbsp;&nbsp;compares case sensitive<br>
''string1'' = ''string2''
::compares case sensitive<br>
''string1'' sameAs: ''string2''<br>&nbsp;&nbsp;compares case insensitive
''string1'' sameAs: ''string2''
::compares case insensitive


==== Case Conversion ====
==== Case Conversion ====
''aString'' asLowercase
''aString'' asLowercase
<br>''aString'' asUppercase
<br>''aString'' asUppercase
<br>''aString'' asUppercaseFirst<br>&nbsp;&nbsp;return a case converted string
<br>''aString'' asUppercaseFirst
::return a case converted string


==== Finding Characters or Substrings ====
==== Finding Characters or Substrings ====
''aString'' indexOf: ''aCharacter''
''aString'' indexOf: ''aCharacter''<br>&nbsp;&nbsp;return the 1-based index, or 0 if not found.<br>&nbsp;&nbsp;Notice that character constants are denoted as $x in Smalltalk (or "Character return", "Character newline", "Character tab"...)
::returns the 1-based index, or 0 if not found.<br>&nbsp;&nbsp;Notice that character constants are denoted as $x in Smalltalk (or "Character return", "Character newline", "Character tab"...)
''aString'' lastIndexOf: ''aCharacter''<br>&nbsp;&nbsp;searching from the end, return the 1-based index, or 0 if not found.
''aString'' includes: ''aCharacter''<br>&nbsp;&nbsp;return true if the character is included, false if not
''aString'' lastIndexOf: ''aCharacter''
::searching from the end, returns the 1-based index, or 0 if not found.
''aString'' includes: ''aCharacter''
::returns true if the character is included, false if not


Reference: [http://live.exept.de/ClassDoc/classDocOf:,String String]
Reference: [http://live.exept.de/ClassDoc/classDocOf:,String String]

Version vom 25. September 2020, 17:32 Uhr

This document lists most useful (and most often needed) classes and functions. Be aware, that there are many more to be found in either the class references or via the builtin class browser.

String[Bearbeiten]

All of the following are functional operators; meaning that they do not modify the argument(s).

Comparing[Bearbeiten]

string1 = string2

compares case sensitive

string1 sameAs: string2

compares case insensitive

Case Conversion[Bearbeiten]

aString asLowercase
aString asUppercase
aString asUppercaseFirst

return a case converted string

Finding Characters or Substrings[Bearbeiten]

aString indexOf: aCharacter

returns the 1-based index, or 0 if not found.
  Notice that character constants are denoted as $x in Smalltalk (or "Character return", "Character newline", "Character tab"...)

aString lastIndexOf: aCharacter

searching from the end, returns the 1-based index, or 0 if not found.

aString includes: aCharacter

returns true if the character is included, false if not

Reference: String inherits from: CharacterArray and SequenceableCollection and Collection

Collection[Bearbeiten]

Reference: Collection

Filename[Bearbeiten]

Reference: Filename

Stream[Bearbeiten]

Reference: Stream

Number[Bearbeiten]

Reference: Number and its subclasses Integer, Float, Fraction, Complex



Copyright © 2014-2024 eXept Software AG