How to split string


#1

Hi,

i’m trying to split this string in from 1 cell in my data table

1:14-cv-10864-TLL-SDD
Maye Klee sample

i just need the 1:14-cv-10864.


#2

@JayR
stra=1:14-cv-10864-TLL-SDD
ListB=stra.Split({"-"},stringSplitOptions.RemoveEmptyEntries).ToList

output=string.Join("-",ListB.Take(3))

Regards,
Mahesh