Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 12:38 25 Nov 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Does MMBasic have a REPLACE function (or sub)

Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4411
Posted: 10:36pm 24 Nov 2026
Copy link to clipboard 
Print this post

Hi folks,

Does MMBasic have a single function/sub that does string matching and replacement yet? - I'm not aware of anything up to v6 but I haven't been paying full attentions since then.

Thanks,

Tom
Edited 2026-11-25 08:37 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
homa

Guru

Joined: 05/11/2021
Location: Germany
Posts: 785
Posted: 11:09pm 24 Nov 2026
Copy link to clipboard 
Print this post

Not exactly string, BUT
LONGSTRING REPLACE array%() , string$, start
Will substitute characters in the normal MMBasic string ‘string$’ into an
existing long string ‘array%()’ starting at position ‘start’ in the long string.

OR

Appendix E – Regex Syntax
Regex Syntax
The alternate forms of the INSTR() and LINSTR() functions can take a regular expression as the search pattern.
The alternate form of the functions are:
INSTR([start],text$, search$ [,size])
LINSTR(text%(),search$ [,start] [,size]
Edited 2026-11-25 09:11 by homa
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026