MID (function)

The MID function returns a (dynamic) string containing a specified number of characters from a string. It has three parameters.

The first parameter is the string expression from which characters are returned. If string is empty, an empty string is returned.

The second parameter is the character position in string at which the part to be taken begins. If start is greater than the number of characters in string, MID returns a zero-length string ("").

The third parameter is optional, and gives the number of characters to return. If omitted or if there are fewer than length characters in the text (including the character at start), all characters from the start position to the end of the string are returned.

SYNTAX

 = MID( text, position )


Legend
  • id : identifier
  • type : datatype
  • v : value
  • "..." : string
  • [...] : optional

EXAMPLE

 x = MID( "TEST", 2 )


Used in:

ABBREVIATION: Mi

Join BASIC 10Liner Contest with ugBASIC!

An interesting competition is held at the beginning of each year: the BASIC 10Liner Contest. It is possible to use ugBASIC to participate in the next "BASIC10Liner" competition, in the following categories:

  • PUR-120 - A game in 10 lines of max 120 characters (w/abbrev.)
  • EXTREME-256 - A game in 10 lines of max 256 characters (w/abbrev.)
  • SCHAU - Any program in 10 lines of max 256 characters (w/abbrev.)
In order to reduce space you can use this abbreviation for this instruction:

MID (function) ↔ Mi

Any problem?

If you have found a problem with this keyword, if you think there is a bug or, more simply, you would like it to be improved, open an issue for this example on GitHub.
Thank you!

open an issue BACK TO KEYWORDS