If you are unable to create a new account, please email bspsoftware@techdata.com

Author Topic: Help with string split  (Read 277 times)

Offline nandamuri

  • Associate
  • **
  • Join Date: Nov 2022
  • Posts: 2
  • Forum Citizenship: +0/-0
Help with string split
« on: 09 May 2023 02:31:58 pm »
Hello all, I have a prompt that takes a string which will have text separated by |. For example: abcde|ef|ghi|

The string can be any length and can have any |.

I need to extract like this (below) to compare and find any data that matches to the string.

1: abcde
2: abcde|ef
3: abcde|ef|ghi
3: abcde|ef|ghi% (any thing that starts with abcde|ef|ghi)

I am lost and have no clue on how to do this..any help is apprecated. TIA

Offline dougp

  • Statesman
  • ******
  • Join Date: Jul 2014
  • Posts: 868
  • Forum Citizenship: +30/-1
Re: Help with string split
« Reply #1 on: 09 May 2023 03:29:37 pm »
sample input and output please

Offline nandamuri

  • Associate
  • **
  • Join Date: Nov 2022
  • Posts: 2
  • Forum Citizenship: +0/-0
Re: Help with string split
« Reply #2 on: 10 May 2023 09:09:34 am »
Thank you, Doug..

So, the input comes from the prompt.
The string entered will have text separated by |. For example: abcde|ef|ghi|

The string can be any length and can have any |.

Now I have to check if there are any matches in the database like this -
1: abcde
2: abcde|ef
3: abcde|ef|ghi
3: abcde|ef|ghi% (any thing that starts with abcde|ef|ghi)