Ask Your Question

Extrapolate part from string variable

asked 2017-06-22 10:12:07 +0200

Fede gravatar image

updated 2017-06-22 10:13:11 +0200


If I have a string variable (ex "A25") and i Would like to extract only "25" from this string, I have to use the "MID" function of calc with the command call.function?


Thanks in advance

Good Life

LO: 5.2 and 5.3

SO: Windows 7 and 10

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2017-06-22 10:37:59 +0200

pierre-yves samyn gravatar image


With EditFind & Replace:

  • Find: \D
  • Replace: nothing (keep empty)
  • Other options: tick Regular expressions

Explanation: \D Match any character that is not a decimal digit.


edit flag offensive delete link more


Sorry, I wan not clear

In Starbasic, I have a string variable

dim s$ s = "A25"

So I would like to define a second variable that contain a parte of the string "s"

dim s2$ s2 = "25"

Is there a function that allow to extrapolate "25" from the string "s"? [so s2 = f (s)]

Thank you

Fede gravatar imageFede ( 2017-06-22 13:28:21 +0200 )edit

s2 = Right( s, 2 ) REM take the last two characters of s.


s2 = Mid( s, 2 )    REM take all characters from s, starting at the second character.
librebel gravatar imagelibrebel ( 2017-06-22 14:07:26 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-06-22 10:12:07 +0200

Seen: 98 times

Last updated: Jun 22 '17