Useful API Functions: Unterschied zwischen den Versionen

Aus expecco Wiki (Version 2.x)
Zur Navigation springen Zur Suche springen
Zeile 23: Zeile 23:
===== copyTo: =====
===== copyTo: =====
''aString'' copyTo:''endIndex''
''aString'' copyTo:''endIndex''
''aString''.copyTo(''endIndex'') [JS]


Example:
Example:

Version vom 27. Juli 2019, 14:23 Uhr

String[Bearbeiten]

Copying[Bearbeiten]

Notice: except when written otherwise, all indices are 1-based. Valid indices range from 1 to the string's size.

copyFrom:to:[Bearbeiten]
aString copyFrom:startIndex to:endIndex
aString.copyFrom_to(startIndex, endIndex) [JS]

Example:

 'hello world' copyFrom:1 to:5. 
 => 'hello'
copyFrom:[Bearbeiten]
aString copyFrom:startIndex'
aString.copyFrom(startIndex) [JS]

Example:

 'hello world' copyFrom:6. 
 => ' world'
copyTo:[Bearbeiten]
aString copyTo:endIndex
aString.copyTo(endIndex) [JS]

Example:

 'hello world' copyTo:6. 
 => 'hello '



Copyright © 2014-2024 eXept Software AG