GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Download
  • News
  • Community
  • Resources
  • Language Reference
  • SmallBASIC Manual

This view

  • Original page
  • New address

GeezerVison is showing smallbasic.github.io — SmallBASIC | TRANSLATE

Edit History

TRANSLATE

s = TRANSLATE (source, what [, with])

Home > Reference > String

Translates all occurrences of the string what found in string source with the string with and returns the new string. If with is not given, all occurrences of what will be removed.

Example 1: Replace

s1 = "ab_cd_ef"
s2 = translate(s1, "_", "!")
print s1 + " -> "; s2          ' Output: ab_cd_ef -> ab!cd!ef

Example 2: Remove

s1 = "ab_cd_ef"
s2 = translate(s1, "cd")
print s1 + " -> "; s2          ' Output: ab_cd_ef -> ab__ef
Code samples using TRANSLATE
3d rotating cube with message.bas   A Rubens, Peter Paul Landscape.bas   autumn scene.bas   base64.bas   btn 21.bas   bulls and cows.bas   graphics sampler.bas   irc-bot.bas   mastermind.bas   pirate.bas   PRINTA_OKOK.bas   scambling text.bas   scampling.bas   shooter.bas   sineballcube.bas   slide sq w mouse.bas   sliding blocks.bas   snow snake.bas   space shooter.bas   square elimination game v3.bas   startrek.bas   startrek.bas  
String
ASC   BCS   BIN   CBS   CHOP   CHR   DISCLOSE   ENCLOSE   FORMAT   HEX   INSTR   JOIN   LCASE   LEFT   LEFTOF   LEFTOFLAST   LOWER   LTRIM   MID   OCT   REPLACE   RIGHT   RIGHTOF   RIGHTOFLAST   RINSTR   RTRIM   SINPUT   SPACE   SPC   SPLIT   SPRINT   SQUEEZE   STR   STRING   TRANSLATE   TRIM   UCASE   UPPER   VAL  
This page was last edited on Mon, 4 Sep 2023 16:06:55 +0200 | Markdown processed with pandoc 3.1.12.1
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.