# How to Use Split function or Substring?

**URL:** <https://forum.uipath.com/t/how-to-use-split-function-or-substring/127805>\
**Category:** Help\
**Tags:** system, activities\
**Created:** [June 24, 2019, 6:34pm UTC](https://forum.uipath.com/t/how-to-use-split-function-or-substring/127805 "2019-06-24T18:34:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiranbgtechm](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/kiranbgtechm/32/177051_2.png) [@kiranbgtechm](https://forum.uipath.com/u/kiranbgtechm)\
**Post date:** [June 24, 2019, 6:34pm UTC](https://forum.uipath.com/t/how-to-use-split-function-or-substring/127805/1 "2019-06-24T18:34:48Z")

</div>

Hi All,

I am a beginner and need your support for the below problem.

I get a string value from the mail subject as mentioned below. i need to split it and put it in a separate variables for processing further.

Example:  
**You paid Rs. 8 to Cosmo Juice And Cakes**

In the above sentence the want “8” and “Cosmo Juice And Cakes” to be stored in Variables Amount and Vendor.

I’m thinking of using split function.I want to store the value before “to” in Amount variable and after “to” in Vendor variable.

Can someone suggest me,how can i do this?

---

<div class="post-metadata">

**Author:** ![MickeyFireMouse](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/mickeyfiremouse/32/54774_2.png) [@MickeyFireMouse](https://forum.uipath.com/u/MickeyFireMouse)\
**Post date:** [June 24, 2019, 7:11pm UTC](https://forum.uipath.com/t/how-to-use-split-function-or-substring/127805/2 "2019-06-24T19:11:52Z")

</div>

Hi @kiranbgtechm  
See this post:

> [@Extract word between two known words](https://forum.uipath.com/t/extract-word-between-two-known-words/12779):
>
> Hi Is there any way to read a particular word which is between two known words with the help of regex? eg If input is Name ABCD Age, I need to extract ABCD. Instead of using substring function, is there any way we can utilize any regex?

Hope this helps

---

<div class="post-metadata">

**Author:** ![Raghavendraprasad](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/raghavendraprasad/32/66936_2.png) [@Raghavendraprasad](https://forum.uipath.com/u/Raghavendraprasad)\
**Post date:** [June 24, 2019, 7:28pm UTC](https://forum.uipath.com/t/how-to-use-split-function-or-substring/127805/3 "2019-06-24T19:28:09Z")

</div>

Well,

Here is a xaml file detailing how to achieve that. Hope this helps

[spilitstringarray.xaml](https://forum.uipath.com/uploads/short-url/oUjtQPHTOKAJIoZt3GwSFKKZO6l.xaml) (5.9 KB)

---

<div class="post-metadata">

**Author:** ![Jarzzz](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/jarzzz/32/63669_2.png) [@Jarzzz](https://forum.uipath.com/u/Jarzzz)\
**Post date:** [June 24, 2019, 7:35pm UTC](https://forum.uipath.com/t/how-to-use-split-function-or-substring/127805/4 "2019-06-24T19:35:12Z")

</div>

Outside of what was already linked… I recommend reading through the following so you understand the Split and Substring call.

> **[String.Split Method (System)](https://learn.microsoft.com/en-us/dotnet/api/system.string.split?view=netframework-4.8)**
>
> Returns a string array that contains the substrings in this instance that are delimited by elements of a specified string or Unicode character array.

> **[String.Substring Method (System)](https://learn.microsoft.com/en-us/dotnet/api/system.string.substring?view=netframework-4.8)**
>
> Retrieves a substring from this instance. This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

---

<div class="post-metadata">

**Author:** ![kiranbgtechm](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/kiranbgtechm/32/177051_2.png) [@kiranbgtechm](https://forum.uipath.com/u/kiranbgtechm)\
**Post date:** [June 25, 2019, 12:49am UTC](https://forum.uipath.com/t/how-to-use-split-function-or-substring/127805/5 "2019-06-25T00:49:19Z")

</div>

Thanks a lot! 🙂

---

<div class="post-metadata">

**Author:** ![kiranbgtechm](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/kiranbgtechm/32/177051_2.png) [@kiranbgtechm](https://forum.uipath.com/u/kiranbgtechm)\
**Post date:** [June 25, 2019, 12:50am UTC](https://forum.uipath.com/t/how-to-use-split-function-or-substring/127805/6 "2019-06-25T00:50:21Z")

</div>

Thank you so much Raghavendra! 🙂

---

<div class="post-metadata">

**Author:** ![kiranbgtechm](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/kiranbgtechm/32/177051_2.png) [@kiranbgtechm](https://forum.uipath.com/u/kiranbgtechm)\
**Post date:** [June 25, 2019, 12:51am UTC](https://forum.uipath.com/t/how-to-use-split-function-or-substring/127805/7 "2019-06-25T00:51:08Z")

</div>

Thank you for sharing 🙂 will go through

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [June 28, 2019, 12:51am UTC](https://forum.uipath.com/t/how-to-use-split-function-or-substring/127805/8 "2019-06-28T00:51:09Z")

</div>

Closed on June 28, 2019, 12:51am UTC

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