Input file ends with username - no matter username is capital or in small letter

Hi Friends,

Lets consider my input file name for bot processing is : TestFile_XYZ
(Note : XYZ is username)
sometime file name for bot processing is : TestFile_xyz

so how we can get correct file name, no matter username is capital or in small letter.

Hi @Rup_1

We can use Regex or String Manipulation to achieve this. Preview the pattern here.

Use it an assign like this:

Left Assign:

Right Assign:
system.Text.RegularExpressions.Regex.Match(YOURSTRING, “(?<=_).+”).ToString



You could split on the character “_” and get the 2nd result.

You can learn Regex here:

You can learn String Manipulation here:
How to manipulate a part of string: Split, Trim, Substring, Replace, Remove, Left, Right - News / Tutorials - UiPath Community Forum

Hopefully this helps :blush:




In Windows OS, as file name is case-insensitive, difference of upper and lower case letters in filename has no effect.
Do you have any problem? If it’s necessary to compare their equality ignoring case, we can use ToLower or ToUpper method like

filePathA.ToLower = filePathB.ToLower