How to remove one character from front or end of a string ?

1,039 views
Skip to first unread message
Assigned to italob...@gmail.com by me

Jayanth Acharya

unread,
Aug 7, 2015, 3:10:15 AM8/7/15
to MIT App Inventor Forum
How can I remove one character from front or rear end of a string. I'm interested in both the removed character, and the resultant smaller string.

Italo

unread,
Aug 7, 2015, 4:23:16 AM8/7/15
to MIT App Inventor Forum
You have to use the SEGMENT block, specifying the text that you want to chop, where you want to chop it and for how long.
For example, if you want the first character of a text, you should do this

This will return "T"

Now if you want the last character, How would you do it?
Hint: use the LENGTH block as one of the parameters of SEGMENT



If you get that, then you will also know how to get the text in the middle.

Jayanth Acharya

unread,
Aug 7, 2015, 5:26:36 AM8/7/15
to MIT App Inventor Forum
Got it, thanks.
Reply all
Reply to author
Forward
0 new messages