Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Suggestion for new REPLACE$() function
#1
Star 
Lately I was writing a bit of code to do some job for my work.  Importing a clipboarded Excel column into an array, it came in as one large string.
Lazy as I am I thought to make ChatGPT do the dirty work   Smile  but as usual, it made a mess of the program.
It seems that ChatGPT doesn't know too much about QB64PE (just as Copilot as mentioned in another post), so in the end I gave up with it and provided the link of the wiki.  Which it immediately started scanning, so who knows, next time ....

As usual it was using non-existing commands.  But this time, it was a very interesting command:

_REPLACE$(source$,old$,new$)

Where in a source$, every occurrance of old$ was replaced with new$.
For a single replace, you could code this with a few commands, With multiple occurences, the code gets somewhat more complex, so here lies the real strength. Then I thought how nice it would be to have a fast, internal command.  There are many occasons where this is useful, like replacing the comma's for dots in a large number.  Now, I have a multi-line function for that.

Now I don't know if this is the right section of the forum, but I did not see a better place for the suggestion. If there is, please move it there!
Reply


Messages In This Thread
Suggestion for new REPLACE$() function - by zaadstra - 01-25-2026, 04:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is there a menu function? Mad Axeman 17 1,021 12-17-2025, 04:43 AM
Last Post: SMcNeill
  SCREEN Function CletusSnow 8 806 11-16-2025, 05:09 PM
Last Post: TempodiBasic
  Replace routine Pete 3 742 10-31-2024, 04:46 PM
Last Post: Pete
  Using the Screen function PhilOfPerth 19 3,046 04-16-2024, 05:23 PM
Last Post: bobalooie
  Problem with one function Kernelpanic 3 852 08-29-2023, 11:26 PM
Last Post: Kernelpanic

Forum Jump:


Users browsing this thread: 1 Guest(s)