How to get the date value from a string

Hi Team,

Presently working on Citrix Environment, we are having a table with data as it s Citrix we are not able to copy the data as per the BA suggestion we are able to copy the text and save it in a string variable, the data in the string looks like as given below,

002814 STE M 05/01/2018
0026727 BAIG M 10/01/2018


Note: The length of the string varies cannot use sub string.

My aim is to get the number of rows in the text given above, what I am thinking is to find the date in the string and search based on the date how many times the date is present in the given string.

Thanks in advance.

1 Like

Hi there @harsha8687,
If you simply need the number of Rows, then Split the given String on new line characters and Count the results.

For instance:

  • Assign - arrSplitString = strOriginalString.Split(Char.Parse(vbcr))
  • Assign - intNumberOfRows = arrSplitString.Count

Thanks in advance

1 Like

Hey @harsha8687

you can use below Regex Pattern too to get Dates from String.


Reference - regex101: build, test, and debug regex


1 Like

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