What is the command to resize a string? Example:
I want to resize "electric guitar" to just "electric"
(AKA removing the last eight characters)
Are there any commands to do this?
Truncating Strings
Moderators:Administrator, Global Moderator
-
- Newbie
- Posts:8
- Joined:Tue Jun 18, 2002 12:25 am
- Contact:
Re: Truncating Strings
If you want to seperate it based on spaces try:
L=LEN(A$)
FOR A=1 TO L
B$=MID$(L,A$,1)
IF B$=" " THEN GOTO 10
NEXT
10 C$=LEFT$(A$,L)
That's from memory, so you probably should check the help file for MID$ cuz I don't remember which (L A$ or 1) goes where, but L is the position, A$ is the string, and 1 is the length.
L=LEN(A$)
FOR A=1 TO L
B$=MID$(L,A$,1)
IF B$=" " THEN GOTO 10
NEXT
10 C$=LEFT$(A$,L)
That's from memory, so you probably should check the help file for MID$ cuz I don't remember which (L A$ or 1) goes where, but L is the position, A$ is the string, and 1 is the length.