UiARD Exam QuestionsBrowse all questions from this exam

UiARD Exam - Question 44


A developer needs to create an automation process that identifies a file with format "Monthly_Report_MMddyyyy.xlsx". The file name is saved to a variable called strinput.

To extract the date from strinput, which string manipulation method should be used?

Show Answer
Correct Answer: A

To extract the date from the variable strinput, the method to use is strinput.Substring(strInput.LastIndexOf('_') + 1, 8). This uses the Substring method to start right after the last underscore in the file name, continuing for 8 characters which corresponds to the MMddyyyy date format.

Discussion

8 comments
Sign in to comment
Engineer24Option: A
Apr 13, 2024

If you test in studio, just first option works and extract the format "MMDDYYYY".

TharakaOption: A
Jun 23, 2024

Correct answer is A Explanation: The Substring method is used to extract a portion of a string based on the specified start index and length. strinput.LastIndexOf("_") returns the index of the last occurrence of the underscore "_" character in the string. Adding 1 to the index (strinput.LastIndexOf("_")+1) will move the starting position to the character right after the underscore. The second argument, 8, indicates the length of the substring to extract, which in this case is 8 characters representing the date "MMddyyyy" (i.e., the month, day, and year). By using strinput.Substring(strInput.LastIndexOf("_")+1,8), you can extract the date portion from the file name. Therefore, the correct choice is option A: strinput.Substring(strInput.LastIndexOf("_")+1,8).

MirjalolOption: A
Jul 17, 2024

Answer = 'A', tested in uipath studio

OnlineOption: A
Apr 4, 2024

https://learn.microsoft.com/en-us/dotnet/api/system.string.lastindexof?view=net-8.0

Shane1407
Apr 8, 2024

A must be the right answer

bhaskar5a5
Sep 6, 2024

Ans :A

IngvarnOption: A
Nov 6, 2024

Answer = 'A'

IngvarnOption: A
Nov 22, 2024

Answer = 'A'