Is there a strpost in reverse? (extract text from right side)

kanika
kanika Member Posts: 247
edited 2018-07-17 in NAV Three Tier
If strpos find the first ocurrence of substring within a string but I need the last ocurrence.

Is there a function?

for example:

string:= 'file://\\Client\I$\INFORMES D&B\BGREEN BIOLOGICAL SYSTEMS SL.htm'

I need to extract 'BGREEN BIOLOGICAL SYSTEMS SL.htm'

but i need to find the last '\'

the string is variable because they are addresses of linked files

Thanks for advance!!!

Best Answer

Answers

  • kanika
    kanika Member Posts: 247
    Muchísimas gracias!!!
  • Slawek_Guzek
    Slawek_Guzek Member Posts: 1,692
    Why re-inventing the wheel? Check the GetFileName() function in C419 File Management..
    Slawek Guzek - www.yitron.co.uk
    Business Central, MS SQL Server, Wherescape RED;
  • kanika
    kanika Member Posts: 247
    "in C419 File Management"
    what is this?
  • Slawek_Guzek
    Slawek_Guzek Member Posts: 1,692
    Codeunit 419 File Management
    Slawek Guzek - www.yitron.co.uk
    Business Central, MS SQL Server, Wherescape RED;
  • kanika
    kanika Member Posts: 247
    Ah ok!!! Sorry,

    CU419 thanks!!