# Using .trim() on a variable for SetText is not removing the trailing space in the variable

**URL:** <https://forum.katalon.com/t/using-trim-on-a-variable-for-settext-is-not-removing-the-trailing-space-in-the-variable/39507>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [February 5, 2020, 7:58pm UTC](https://forum.katalon.com/t/using-trim-on-a-variable-for-settext-is-not-removing-the-trailing-space-in-the-variable/39507 "2020-02-05T19:58:27Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![mridula.palivela](https://avatars.discourse-cdn.com/v4/letter/m/3e96dc/32.png) [@mridula.palivela](https://forum.katalon.com/u/mridula.palivela)\
**Post date:** [February 6, 2020, 2:25am UTC](https://forum.katalon.com/t/using-trim-on-a-variable-for-settext-is-not-removing-the-trailing-space-in-the-variable/39507/14 "2020-02-06T02:25:43Z")

</div>

Feeling silly that I did not check the html after I entered the name in the input field using the variable… it showed Nanci&nbsp. But thanks @kazurayam for helping me figure this out!

Thanks @Russ_Thomas for you help!

Used this post to figure out what to use to replace the no break space - [WebUI.getText not trimming trailing space](http://forum.katalon.com/t/webui-gettext-not-trimming-trailing-space/25054)

---

_[View the full topic](https://forum.katalon.com/t/using-trim-on-a-variable-for-settext-is-not-removing-the-trailing-space-in-the-variable/39507)._
