How do I delete a number of letters from the beginning of the text?
@point, check out this get substring from text
block. The example below returns the string “Text”.
Happy Coding!
Darren
Thunkable X Tutorials
Hey Darren: How would you get a substring that cuts off the end of a string. For example, “Los Angeles, CA, 90032, USA”
I want to pick up “Los Angeles, CA” but the data will different on every record. The next one might be “Tucson, AZ, 89002, USA” and I only want “Tucson, AZ”
Thanks Darren
George
The text functions do not seem to let me choose the second or third occurrence, just first or last…
actech: Seems like it wants to work, but I cannot get the substring to show up on the screen. Any further help is appreciated.
Thank you
To find an error, you need to look at the value of all the blocks with app variables. Perhaps there are incorrect values somewhere in them. If you use app blocks, you don’t need the parameters in the function, but you left them for some reason.
Here’s a simplified (i.e. less dynamically configurable) version of the above that works fine for me:
Here’s the project page link to try:
https://x.thunkable.com/projectPage/5f352f3b547fca46f78f550a/
Thanks to both of you. I now have this working. My use case was pulling a formatted address from the Open Cage API. The addresses include street, city, state, zip, and country. My users will know state, zip and country, so they do need to be displayed. So the methods you guys provided allow me to get a clean display of just “street” or “street, city.” Appreciate the help and the rapid turnaround.