Split string by length

Hi @Badagala_Jagadeesh

Based on you requirement, please find the solution below:

  1. Create a variable as “test” string and assign your text:
    “hewlett-packard singapore (private) limited”

  2. splitIndex = (test.Substring(0, 35).LastIndexOf(" ") + 1)

  3. test.Substring(0, splitIndex) : This will return your first part

  4. test.Substring(splitIndex, (test.Length-splitIndex)) : This will return your second part

Hope this will solve your problem

4 Likes