# Split String Issues

**URL:** <https://forum.uipath.com/t/split-string-issues/2577>\
**Category:** Help\
**Tags:** system, activities\
**Created:** [March 21, 2017, 3:58am UTC](https://forum.uipath.com/t/split-string-issues/2577 "2017-03-21T03:58:52Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![nesachdeva](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@nesachdeva](https://forum.uipath.com/u/nesachdeva)\
**Post date:** [March 21, 2017, 3:58am UTC](https://forum.uipath.com/t/split-string-issues/2577/1 "2017-03-21T03:58:52Z")

</div>

I am trying to split a string(defined as Generic Type) P 12345 as P and 12345

I have first converted it into String. Next, I have used the Split function as :  
Split(ManagerDetails.tostring,“P”)

 ![](https://global.discourse-cdn.com/uipath/original/2X/d/d2310764bac11b1266fde0be0f9611a03f612c1c.png)

Using for loop, I am trying to capture each of the elements. But the output is not as expected. It appears to be System.String and System.String

 ![](https://global.discourse-cdn.com/uipath/original/2X/b/b40bcce311aed9137caa799de5191bcaed0a25b8.png)

Can someone provide the solution for this?

P.S I have tried using the Split Activity under expressions. The output remains the same.

---

<div class="post-metadata">

**Author:** ![aksh1yadav](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/aksh1yadav/32/135359_2.png) [@aksh1yadav](https://forum.uipath.com/u/aksh1yadav)\
**Post date:** [March 21, 2017, 4:06am UTC](https://forum.uipath.com/t/split-string-issues/2577/2 "2017-03-21T04:06:54Z")

</div>

Hey @nesachdeva

please review the attached sample workflow and let me know.

here you should split on the basis of space.

> str.Split({" "c}, StringSplitOptions.RemoveEmptyEntries)

[splitstring.xaml](https://global.discourse-cdn.com/uipath/original/2X/7/702eea381750aca1b000b89893e75ea7b61fc010.xaml) (7.0 KB)

Regards…!!  
Aksh

---

<div class="post-metadata">

**Author:** ![nesachdeva](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@nesachdeva](https://forum.uipath.com/u/nesachdeva)\
**Post date:** [March 21, 2017, 4:32am UTC](https://forum.uipath.com/t/split-string-issues/2577/3 "2017-03-21T04:32:26Z")

</div>

That worked! Thanks!

Can you help me out on saving the output 12345 into a variable?

---

<div class="post-metadata">

**Author:** ![aksh1yadav](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/aksh1yadav/32/135359_2.png) [@aksh1yadav](https://forum.uipath.com/u/aksh1yadav)\
**Post date:** [March 21, 2017, 4:35am UTC](https://forum.uipath.com/t/split-string-issues/2577/4 "2017-03-21T04:35:51Z")

</div>

Hi @nesachdeva

If you always gets the same string then just use if condition and compare the word and assign it into a new variable.

Regards…!!  
Aksh

---

<div class="post-metadata">

**Author:** ![nesachdeva](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@nesachdeva](https://forum.uipath.com/u/nesachdeva)\
**Post date:** [March 21, 2017, 4:38am UTC](https://forum.uipath.com/t/split-string-issues/2577/5 "2017-03-21T04:38:23Z")

</div>

Nope, it changes every time.

---

<div class="post-metadata">

**Author:** ![aksh1yadav](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/aksh1yadav/32/135359_2.png) [@aksh1yadav](https://forum.uipath.com/u/aksh1yadav)\
**Post date:** [March 21, 2017, 4:44am UTC](https://forum.uipath.com/t/split-string-issues/2577/6 "2017-03-21T04:44:53Z")

</div>

In that case you just let me know the string count you will always? get same? and the first character will be “P” or different.

So i am assuming if the string count will be same then based on count you can fire the if condition and assign the word into some variable.

Hope it will be useful for you…!!

Regards…!!  
Aksh

---

<div class="post-metadata">

**Author:** ![nesachdeva](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@nesachdeva](https://forum.uipath.com/u/nesachdeva)\
**Post date:** [March 21, 2017, 4:59am UTC](https://forum.uipath.com/t/split-string-issues/2577/7 "2017-03-21T04:59:35Z")

</div>

the string count is 11.  
P 12345678

---

<div class="post-metadata">

**Author:** ![aksh1yadav](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/aksh1yadav/32/135359_2.png) [@aksh1yadav](https://forum.uipath.com/u/aksh1yadav)\
**Post date:** [March 21, 2017, 5:26am UTC](https://forum.uipath.com/t/split-string-issues/2577/8 "2017-03-21T05:26:48Z")

</div>

i was asking about after space but based on assumption you can do this.

 ![](https://global.discourse-cdn.com/uipath/original/2X/b/b8b9c47ae95c77b7cca106b15ffb5d25572cbf5f.jpg)

Hope this will be useful for you.

Regards…!!  
Aksh

---

<div class="post-metadata">

**Author:** ![nesachdeva](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@nesachdeva](https://forum.uipath.com/u/nesachdeva)\
**Post date:** [March 21, 2017, 5:28am UTC](https://forum.uipath.com/t/split-string-issues/2577/9 "2017-03-21T05:28:02Z")

</div>

That looks fine.  
Sorry, i missed about the spaces, there are two spaces between P and the digits.

Thanks for the prompt help!! 🙂

---

<div class="post-metadata">

**Author:** ![Ramesh](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@Ramesh](https://forum.uipath.com/u/Ramesh)\
**Post date:** [June 9, 2017, 1:30pm UTC](https://forum.uipath.com/t/split-string-issues/2577/10 "2017-06-09T13:30:43Z")

</div>

Hi

can u help me how to split variable from pdf

---

<div class="post-metadata">

**Author:** ![UiJules](https://avatars.discourse-cdn.com/v4/letter/u/3e96dc/32.png) [@UiJules](https://forum.uipath.com/u/UiJules)\
**Post date:** [July 18, 2017, 4:12pm UTC](https://forum.uipath.com/t/split-string-issues/2577/11 "2017-07-18T16:12:04Z")

</div>

Hi @aksh1yadav ,  
Can you tell me that “c” from str.Split({" "c} stands for what? I understand that the split will be made between spaces but don’t see the point of the _c_

(I’ve seen this c several times but no idea what it is used for)

Thank you and regards,  
Jules

---

<div class="post-metadata">

**Author:** ![andrzej.kniola](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/andrzej.kniola/32/8835_2.png) [@andrzej.kniola](https://forum.uipath.com/u/andrzej.kniola)\
**Post date:** [July 18, 2017, 4:30pm UTC](https://forum.uipath.com/t/split-string-issues/2577/12 "2017-07-18T16:30:51Z")

</div>

> [@UiJules](#):
>
> Can you tell me that “c” from str.Split({" "c} stands for what?

It’s there to declare the `" "` as a Char instead of String.  
In C# you’d do it like this:  
`char aChar = ' ';`  
But in [VB.Net](http://VB.Net) apostrophe (or single quotes) `'` are used as comments, so you can’t do it. And quotes are for strings. So instead of adding another special char, you just indicate it with c after a 1-char length string:  
`Dim aChar as Char = " "c`

See [here](https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/constants-enums/constant-and-literal-data-types) for more on MSDN.

---

<div class="post-metadata">

**Author:** ![PrankurJoshi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/prankurjoshi/32/37212_2.png) [@PrankurJoshi](https://forum.uipath.com/u/PrankurJoshi)\
**Post date:** [March 22, 2018, 11:40am UTC](https://forum.uipath.com/t/split-string-issues/2577/13 "2018-03-22T11:40:50Z")

</div>

what does the c mean here

---

<div class="post-metadata">

**Author:** ![arivu96](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@arivu96](https://forum.uipath.com/u/arivu96)\
**Post date:** [March 22, 2018, 11:43am UTC](https://forum.uipath.com/t/split-string-issues/2577/14 "2018-03-22T11:43:43Z")

</div>

Hi @PrankurJoshi,

here **c** -\>Character

Regards,  
Arivu
