# \[Solved\] How to divide/split a string in two parts?

**URL:** <https://community.thunkable.com/t/solved-how-to-divide-split-a-string-in-two-parts/554695>\
**Category:** Questions about Thunkable X\
**Tags:** solved\
**Created:** [April 4, 2020, 2:36am UTC](https://community.thunkable.com/t/solved-how-to-divide-split-a-string-in-two-parts/554695 "2020-04-04T02:36:49Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![a01635401rl](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@a01635401rl](https://community.thunkable.com/u/a01635401rl)\
**Post date:** [April 4, 2020, 2:36am UTC](https://community.thunkable.com/t/solved-how-to-divide-split-a-string-in-two-parts/554695/1 "2020-04-04T02:36:50Z")

</div>

Hello, I have a little question.  
How can I divide for example: hello (I have this in a text variable)  
and I want that h in a new variable and ello in another one.  
I try but I can’t get the blocks to work properly.

Can somebody help me, please. Thank you!

---

<div class="post-metadata">

**Author:** ![nobelp1npk](https://avatars.discourse-cdn.com/v4/letter/n/f19dbf/32.png) [@nobelp1npk](https://community.thunkable.com/u/nobelp1npk)\
**Post date:** [April 4, 2020, 2:43am UTC](https://community.thunkable.com/t/solved-how-to-divide-split-a-string-in-two-parts/554695/2 "2020-04-04T02:43:48Z")

</div>

@a01635401rl can you screenshot your code?

---

<div class="post-metadata">

**Author:** ![kartik14](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik14/32/44782_2.png) [@kartik14](https://community.thunkable.com/u/kartik14)\
**Post date:** [April 4, 2020, 2:57am UTC](https://community.thunkable.com/t/solved-how-to-divide-split-a-string-in-two-parts/554695/3 "2020-04-04T02:57:57Z")

</div>

Hi, @a01635401rl! 👋

You can use this block, but you would require a specific no. of how many letters you want to sub-string. -

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/d/dd76ee5a46ae1480bf499fc91fdc3541d4611173.png)

Thanks! 😊

---

<div class="post-metadata">

**Author:** ![a01635401rl](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@a01635401rl](https://community.thunkable.com/u/a01635401rl)\
**Post date:** [April 4, 2020, 3:10am UTC](https://community.thunkable.com/t/solved-how-to-divide-split-a-string-in-two-parts/554695/4 "2020-04-04T03:10:21Z")

</div>

I have almost nothing, it’s a short exercise, the problem is that I really dont know how to delimit that the “s” is stored in one variable and “aint” in another variable  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/6/56104b0aa3911352a120643e85eeed0dbeaa27d2.png)

---

<div class="post-metadata">

**Author:** ![a01635401rl](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@a01635401rl](https://community.thunkable.com/u/a01635401rl)\
**Post date:** [April 4, 2020, 3:11am UTC](https://community.thunkable.com/t/solved-how-to-divide-split-a-string-in-two-parts/554695/5 "2020-04-04T03:11:21Z")

</div>

thanks!

---

<div class="post-metadata">

**Author:** ![nobelp1npk](https://avatars.discourse-cdn.com/v4/letter/n/f19dbf/32.png) [@nobelp1npk](https://community.thunkable.com/u/nobelp1npk)\
**Post date:** [April 4, 2020, 3:20am UTC](https://community.thunkable.com/t/solved-how-to-divide-split-a-string-in-two-parts/554695/6 "2020-04-04T03:20:51Z")

</div>

Do you mean something like this?

 ![Screenshot 2020-04-04 at 10.05.18](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/5/35af8c275cf54f894a21768fb6a7d73130e7a566.png)

---

<div class="post-metadata">

**Author:** ![a01635401rl](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@a01635401rl](https://community.thunkable.com/u/a01635401rl)\
**Post date:** [April 4, 2020, 3:35am UTC](https://community.thunkable.com/t/solved-how-to-divide-split-a-string-in-two-parts/554695/7 "2020-04-04T03:35:48Z")

</div>

yes, only that for example saint can change to another word with more or fewer letters, how can I configure it so that it always gets the first letter and then the rest, regardless of the number of words in the variable

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [April 4, 2020, 3:43am UTC](https://community.thunkable.com/t/solved-how-to-divide-split-a-string-in-two-parts/554695/8 "2020-04-04T03:43:01Z")

</div>

I think you mean “regardless of the number of letters” but maybe you meant words. Regardless, you should be able to make this work for any length of text by replacing the 5 in “to letter # 5” in @nobelp1npk’s example above with the “length of” block in the Text drawer and then adding _app word_ to it.

---

<div class="post-metadata">

**Author:** ![a01635401rl](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@a01635401rl](https://community.thunkable.com/u/a01635401rl)\
**Post date:** [April 4, 2020, 3:48am UTC](https://community.thunkable.com/t/solved-how-to-divide-split-a-string-in-two-parts/554695/9 "2020-04-04T03:48:18Z")

</div>

That’s right sorry, I meant letters, I got confused.  
Okay, thank you @nobelp1npk and @tatiang for helping!!!

---

<div class="post-metadata">

**Author:** ![nobelp1npk](https://avatars.discourse-cdn.com/v4/letter/n/f19dbf/32.png) [@nobelp1npk](https://community.thunkable.com/u/nobelp1npk)\
**Post date:** [April 4, 2020, 3:49am UTC](https://community.thunkable.com/t/solved-how-to-divide-split-a-string-in-two-parts/554695/10 "2020-04-04T03:49:36Z")

</div>

This should work

 ![Screenshot 2020-04-04 at 10.34.08](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/a/daf7210eb862017c3e50b3aeb01b6fb710742ad0.png)

---

<div class="post-metadata">

**Author:** ![nobelp1npk](https://avatars.discourse-cdn.com/v4/letter/n/f19dbf/32.png) [@nobelp1npk](https://community.thunkable.com/u/nobelp1npk)\
**Post date:** [April 4, 2020, 3:50am UTC](https://community.thunkable.com/t/solved-how-to-divide-split-a-string-in-two-parts/554695/11 "2020-04-04T03:50:08Z")

</div>

yes.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:39am UTC](https://community.thunkable.com/t/solved-how-to-divide-split-a-string-in-two-parts/554695/12 "2024-11-08T11:39:26Z")

</div>


