? SUBST$ command tutorial ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password
[Help Wanted] SmileBASIC Documentation Project

SUBST$ command tutorial

SUBST$ is a command that can replace part of a string. It looks like this.

Syntax

$NEWVAR=SUBST$(StartString,placement,ReplaceString,[CharacterCount])
  1. StartString acts as the full string in which to replace text.
  2. placement acts as a number that sets the start position to remove text.
  3. ReplaceString acts as the string that will be replacing the removed text.
  4. CharacterCount is an optional parameter that chooses how long the removed text will be, if left empty it will be one (I think)

Uses

This can be used in many situations like syntax replacement alongside INSTR.

Examples

Str$=SUBST$("Abcd", 2,"dc") 'Abdc Str$=SUBST$("A cd",2,"b",2) 'Abd
Author
Chemicalex
Updated
Rating
0 votes
Categories
Keywords
2 Comment(s) 12Me21 12Me21 Head Admin Second Year My account is over 2 years old Website Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself If the last parameter is omitted, it will replace until the end of the string. The first example is incorrect; it should be Abdc Chemicalex Chemicalex Drawing I like to draw! Hobbies RNG Hidden Easter Eggs Video Games I like to play video games! Hobbies Old thing but fixed anyway, thanks