Split Index was outside the bound of the Array

Hi,
While splitting the name to Firstname and Lastname using the delimiter “space” and Index as 2,
I am getting the below error.1 2 3
Please help regarding this
Thanks
SunilReddy

welcome @Sunil_Reddy,
Use index as 1 bro,because the array index starts from 0.
Name.split(" "c)(1) .
Cheers.
Vashisht.

1 Like

The issue might be with the data you’re receiving from the Getting Name activity. Please try to print the result after the Getting Name activity.
I created a sample workflow with the same configuration as yours and it works great for me. Please review the workflow. Main.xaml (7.5 KB)

Regards,
Deepak N

Hi
Welcome to uipath community
Hope this would help you
LastName = Split(Name,” “)(2).Tostring.Trim
Conversion of character makes the difference

Cheers @Sunil_Reddy

Hi @Vashisht
I tried using the same, but it throws the same error :frowning:

Hi @Palaniyappan
I tried using the same, but it throws the same error :frowning:

Fine
Kindly pass the output of gettext that is Name as input to writeline activity and let’s check what is the value coming up in the output panel

Cheers @Sunil_Reddy