Exam UiARD All QuestionsBrowse all questions from this 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?

    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
MirjalolOption: A

Answer = 'A', tested in uipath studio

TharakaOption: A

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).

Engineer24Option: A

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

IngvarnOption: A

Answer = 'A'

IngvarnOption: A

Answer = 'A'

bhaskar5a5Option: A

Ans :A

Shane1407Option: A

A must be the right answer

OnlineOption: A

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