Split Text of character

how to split text of string array in to two strings if meet the value “01”.
Meaning it will take text before “01” as string no1 and “019-1…” as string no2 ?

Text : POSSIBLE STRUCTURE 019-1234567

Output shall be :
String 1 : POSSIBLE STRUCTURE
String 2 : 019-1234567

@Poorani_Ramachandran - Please use the first two part of Regex pattern which I have shared in the previous post…

(.*)\s(\d+-\d+)

String 1 = Regexvar(0).groups(1).tostring
String 2 = Regexvar(0).groups(2).tostring

Hope this helps…

1 Like

hi Prashant,
Is there any other method without using regex ?

Hi,

Hope the following helps you.

String1 = yourString.Substring(0,yourString.IndexOf("01"))

String2 = yourString.Substring(yourString.IndexOf("01"))

Regards,

1 Like

str1=Split(String,“01”).First.ToString
str2=“01”+Split(String,“01”).Last.ToString