none
last character of a string could by anything

    Question

  • i have the following string: "A20021600003040.jpg"

    the file name contains one more letter at the end and i need to match them.

    how do i make the last char to be any thing e.g "A200216000030409.jpg" or "A20021600003040W.jpg"

    i have tried "A20021600003040" + "*.jpg"

    help please

    Tuesday, June 7, 2016 9:53 AM

Answers

  • Hi,

    use the string.contains method

    https://msdn.microsoft.com/en-us/library/dy85x1sa%28v=vs.110%29.aspx

    or the string.StartsWith method

    https://msdn.microsoft.com/en-us/library/baketfxw%28v=vs.110%29.aspx

    and search for the fixed part of the string/filename.

    pseude code

    if myFileNameVariable.Contains("A20021600003040") then ...

    or

    if myFileNameVariable.StartsWith("A20021600003040") then ...

    Regards,

      Thorsten




    Tuesday, June 7, 2016 10:03 AM