String Manipulation Problem

Hi, this is in reference to an older post.
If we use Split(text,":W")(1).ToString
The output is orld:Its:Me

If we use Split(text,":")(0).ToString
The output is Hello.

But when we are using Split((Split(text,":W")(1).ToString),":")(0).ToString
How is the output coming orld ?

@ADITYA_MUKHERJEE When you use the Expression Split((Split(text,":W")(1).ToString),":")(0).ToString

Firstly, The inner Split takes place, Hence you get the Output as orld:Its:Me

Next, That Output is given as Input to the Outer Split Method, Hence the output will be Just “orld” since, it is taking the 0th element after the Split

3 Likes

the output which u r getting is correct.

text : hello:World:its:me

I am breaking down this into two parts - Split((Split(text,":W")(1).ToString),":")(0).ToString

  • Split(text,":W")(1).ToString - output - orld:its:me - the inside split statement will give u this as output. Now you are going to split this based on the “:” and u r taking first index (0)

In other words , U r actually splitting (“orld:its:me”) with : and taking index (0)

so the output will be , orld .

1 Like

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