# Keep text from string before certain character

**URL:** <https://forum.uipath.com/t/keep-text-from-string-before-certain-character/208323>\
**Category:** Learning Hub\
**Tags:** studio\
**Created:** [April 2, 2020, 10:39am UTC](https://forum.uipath.com/t/keep-text-from-string-before-certain-character/208323 "2020-04-02T10:39:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dvn](https://avatars.discourse-cdn.com/v4/letter/d/d6d6ee/32.png) [@dvn](https://forum.uipath.com/u/dvn)\
**Post date:** [April 2, 2020, 10:39am UTC](https://forum.uipath.com/t/keep-text-from-string-before-certain-character/208323/1 "2020-04-02T10:39:00Z")

</div>

Hello,

I have a string like so “Jason Bourne - United States”  
The string collects name with nationality divided by “-” from a source but I want to take only the name.  
How can I do that?

Input String: Jason Bourne - United States  
Output String: Jason Bourne

---

<div class="post-metadata">

**Author:** ![supermanPunch](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/supermanpunch/32/133652_2.png) [@supermanPunch](https://forum.uipath.com/u/supermanPunch)\
**Post date:** [April 2, 2020, 10:44am UTC](https://forum.uipath.com/t/keep-text-from-string-before-certain-character/208323/2 "2020-04-02T10:44:54Z")

</div>

@dvn You can use Split Method to Achieve that :  
Use this in a message Box and Check :  
Split(“Jason Bourne - United States”,“-”)(0)
