Split string by occurance

Hello,
I have a string: String1 is the first string.
now i want to split the string from second occurance of s
i.e. output: String1 is

Hi Prathamesh,

Question is not clear, can you provide example strings
that will be easy to understand!!

lets say

string: Hello welcome to UiPath

here i want to split string from second l

op: Hell

here the occurance is depend on me say if i want to split from third l then op will be

op: Hello wel

I suggest making a loop with counter, which will find the index of second occurance of ā€œsā€. Then, if second ā€œsā€ is found, save its index, break the loop, then outside the loop make substring(0,index+1). If needed, do the same substring with the rest of major string.

can you pls provide sample

SplitString.xaml (11.6 KB)

@ImPratham45
There you go. It is splitting text after second occurance of ā€œlā€ in the major string

1 Like

I will let you know

yes its working ty

@ImPratham45 Please pin up my answer as solution for future viewers :slight_smile:

2 Likes