Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remove Spaces (or other characters) from a String
#3
(12-29-2022, 01:36 AM)mnrvovrfc Wrote: Hi George.

Useful function, but you forgot in the example, just below the comment for test #2 to include a period as the value of qstring$.

Good catch! And I thought it worked. Big Grin

Anyway, I tested it again by putting 4 periods in Test #2 and it still worked! Angel

Here is the test output.


Quote:QB64: Test #1 - Remove SPACES from 'New York Yankees
QB64: qString$ = New York Yankees
QB64: retValue$ = NewYorkYankees

QB64: Used in a PRINT stmt, function returns: NewYorkYankees

QB64: Test #2 -Remove SPACES and PERIODS from 'New York Yankees.
QB64: qString$ = New York.Yankees...
QB64: retValue$ = NewYorkYankees

QB64: Used in a PRINT stmt, function returns: NewYork.Yankees...


------------------
(program exited with code: 0)
Press return to continue
—————————————————————————————
George McGinn
Theoretical/Applied Computer Science Specialist
Member: IEEE, IEEE Computer Society
               Technical Council on Software Engineering       
               IEEE Standards Association
               Society of American Baseball Research
Reply


Messages In This Thread
RE: Remove Spaces (or other characters) from a String - by George McGinn - 12-29-2022, 01:54 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  STRING$ empowered with StringPatternFilling TempodiBasic 6 1,236 05-09-2025, 06:00 PM
Last Post: TempodiBasic
  Split String to Array Using Strtok (Attempt #2) SpriggsySpriggs 0 545 12-17-2024, 06:37 PM
Last Post: SpriggsySpriggs
  Remove Remarks for Programs Pete 17 2,972 10-27-2024, 02:22 PM
Last Post: Dimster
  Variable characters eoredson 7 1,520 10-21-2024, 02:55 AM
Last Post: eoredson
  PrintW - print a long string, breaking it at the last space or hyphen before col. 79 TDarcos 21 4,082 04-22-2024, 09:52 PM
Last Post: Pete

Forum Jump:


Users browsing this thread: 1 Guest(s)