# How to replace text with numbers

**URL:** <https://community.thunkable.com/t/how-to-replace-text-with-numbers/2622183>\
**Category:** Questions about Thunkable X\
**Tags:** beginner, help\
**Created:** [October 1, 2023, 6:13am UTC](https://community.thunkable.com/t/how-to-replace-text-with-numbers/2622183 "2023-10-01T06:13:18Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![androidswetha\_90](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/androidswetha_90/32/161306_2.png) [@androidswetha\_90](https://community.thunkable.com/u/androidswetha_90)\
**Post date:** [October 1, 2023, 6:13am UTC](https://community.thunkable.com/t/how-to-replace-text-with-numbers/2622183/1 "2023-10-01T06:13:18Z")

</div>

i have a text in label = ABCD  
i want to replace this text in text box 2 with numbers  
A=1 , B=2 , C=3 ,D=4  
RESULT TO GET IN TEXT BOX 2 = 1234

 ![REPLACE](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0fa5b175aebbc4320d60182906c6638252edd144.png)

---

<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:** [October 1, 2023, 6:43am UTC](https://community.thunkable.com/t/how-to-replace-text-with-numbers/2622183/2 "2023-10-01T06:43:58Z")

</div>

You can loop through each character in the text string:

```auto
Set app variable character list to [make list from text] Label1's Text with delimiter "" (empty string). 
For i=1 to length of [app variable character list] by 1
   If list item #i = "A"
      set list item #i to 1
   If list item #i = "B"
      set list item #i to 2
   If list item #i = "C"
      set list item #i to 3
   If list item #i = "D"
      set list item #i to 4
Set Label2's Text to [make text from list] app variable character list with delimiter ""

```

If you have trouble getting that to work, post a screenshot of the blocks you’ve tried.

---

<div class="post-metadata">

**Author:** ![androidswetha\_90](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/androidswetha_90/32/161306_2.png) [@androidswetha\_90](https://community.thunkable.com/u/androidswetha_90)\
**Post date:** [October 1, 2023, 7:33am UTC](https://community.thunkable.com/t/how-to-replace-text-with-numbers/2622183/3 "2023-10-01T07:33:18Z")

</div>

i dont understand this coding language , please can you do this with block design and reply , pleaseeeeeeeee

---

<div class="post-metadata">

**Author:** ![androidswetha\_90](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/androidswetha_90/32/161306_2.png) [@androidswetha\_90](https://community.thunkable.com/u/androidswetha_90)\
**Post date:** [October 1, 2023, 7:38am UTC](https://community.thunkable.com/t/how-to-replace-text-with-numbers/2622183/4 "2023-10-01T07:38:00Z")

</div>

please make this in block design , i dont understand this coding language , pleaseeee

---

<div class="post-metadata">

**Author:** ![vishruth-ram](https://avatars.discourse-cdn.com/v4/letter/v/82dd89/32.png) [@vishruth-ram](https://community.thunkable.com/u/vishruth-ram)\
**Post date:** [October 1, 2023, 7:53am UTC](https://community.thunkable.com/t/how-to-replace-text-with-numbers/2622183/5 "2023-10-01T07:53:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![androidswetha\_90](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/androidswetha_90/32/161306_2.png) [@androidswetha\_90](https://community.thunkable.com/u/androidswetha_90)\
**Post date:** [October 1, 2023, 8:28am UTC](https://community.thunkable.com/t/how-to-replace-text-with-numbers/2622183/6 "2023-10-01T08:28:25Z")

</div>

THIS IS NOT WORKING , IF I CHANGE THE TEXT IN LABEL 1 = DCBA , THEN THE RESULT I SHOULD GET IS 4321  
I TRIED THIS BELOW CODE AND RESULT IS WRONG

 ![2023-10-01 - 13-56-48 - Thunkable](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/e/3e9611b3985b8cdb5c8c91cad42ece7923fa1cef.png)  
 ![2023-10-01 - 13-57-13 - Thunkable](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/9/49724234659d754045b22618711337f2885b629a.png)

---

<div class="post-metadata">

**Author:** ![vishruth-ram](https://avatars.discourse-cdn.com/v4/letter/v/82dd89/32.png) [@vishruth-ram](https://community.thunkable.com/u/vishruth-ram)\
**Post date:** [October 1, 2023, 10:05am UTC](https://community.thunkable.com/t/how-to-replace-text-with-numbers/2622183/7 "2023-10-01T10:05:02Z")

</div>

It should be get #1 not directly label1’s text

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [October 2, 2023, 8:30am UTC](https://community.thunkable.com/t/how-to-replace-text-with-numbers/2622183/8 "2023-10-02T08:30:42Z")

</div>

you can try these blocks:

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

here’s a sample output:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/2/22818b3a98fd2dc65ea5378ad90c08f091d9c79c.png)

here’s the link to the project (see SCREEN11)  
[https://x.thunkable.com/copy/cb18983152bdcd99c8deabc1174ab877](https://x.thunkable.com/copy/cb18983152bdcd99c8deabc1174ab877)

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [October 2, 2023, 10:26am UTC](https://community.thunkable.com/t/how-to-replace-text-with-numbers/2622183/9 "2023-10-02T10:26:35Z")

</div>

you could use this too if you want:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/6/9674a0cf793c6a769b4fee91468b440cfa895d24.png)

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [October 2, 2023, 11:14am UTC](https://community.thunkable.com/t/how-to-replace-text-with-numbers/2622183/10 "2023-10-02T11:14:25Z")

</div>

Your blocks are doing exactly what you told them to do…

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [December 31, 2023, 11:14am UTC](https://community.thunkable.com/t/how-to-replace-text-with-numbers/2622183/11 "2023-12-31T11:14:40Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
