<RetVar> = get substring of <Var/String> offset = <Var/Number> length = <Var/Number>

This forum serves as MSCI Reference at EGOSOFT. It's Read-Only for non MSCI Group members.

Moderators: Scripting / Modding Moderators, MSCI Moderators

Locked
mark_a_condren
Posts: 1385
Joined: Wed, 3. Aug 05, 05:05
x3tc

<RetVar> = get substring of <Var/String> offset = <Var/Number> length = <Var/Number>

Post by mark_a_condren » Thu, 16. Sep 10, 15:42

<RetVar> = get substring of <Var/String> offset = <Var/Number> length = <Var/Number>


<RetVar> = The commands return, this will be the variable containing the required string.
<Var/String> = The string you wish to get the 'piece' out of.
<Var/Number> = The starting position in the string.
<Var/Number> = How many characters you wish to get out of the selected string.


The first position is 0.

Returns the values (characters) in a string <Var/String> beginning at 'offset = <Var/Number>' and ending after the specified length (number of characters), 'length = <Var/Number>'


Example:

$text = get substring of 'I need to get one piece of text out of this' offset = 10 length = 13

In the above example, $text would be get one piece


Command Location:
  • »» General Commands
    • »» Strings
      <RetVar> = get substring of <Var/String> offset = <Var/Number> length = <Var/Number>

User avatar
X2-Illuminatus
Moderator (Deutsch)
Moderator (Deutsch)
Posts: 21978
Joined: Sun, 2. Apr 06, 16:38
x4

[TiP][49] 287006

Post by X2-Illuminatus » Thu, 14. Oct 10, 17:37

<RetVar> = get substring of <Var/String> offset = <Var/Number> length = <Var/Number>


<RetVar> = Rückgabewert des Befehls, dies wird die Variable sein, die die geforderte Zeichenkette (string) enthält.
<Var/String> = Die Zeichenkette, aus der du einen Teil entfernen möchtest.
<Var/Number> = Die Startstelle in der Zeichenkette.
<Var/Number> = Die Anzahl an Zeichen, die aus der Zeichenkette entfernt werden sollen.


Die erste Stelle ist 0.

Gibt die Werte (Zeichen) aus einer Zeichenkette <Var/String> beginnend an der Stelle 'offset = <Var/Number>' und endend nach der fesgelegten Länge (Anzahl der Zeichen) 'length = <Var/Number>' zurück.


Beispiel:

$text = get substring of 'Ich muss einen Teil des Textes hier herausbekommen' offset = 15 length = 15

In obigem Beispiel wäre $text gleich Teil des Textes.


Zu finden unter:
  • »» General Commands
    • »» Strings
      <RetVar> = get substring of <Var/String> offset = <Var/Number> length = <Var/Number>

Locked

Return to “MSCI Reference”