gokul1904
(Glory 01)
1
Hey guys ,
A string manipulation favour here -
I have my string like -
C:\Users\ggeshtwin\Desktop\AP_All_Latest_Run\FIN B2 03.31.2022.pdf
How do I check if my string ends with “.pdf” so that I can pick that.
I know there is a way like String.contains(“.pdf”)
But wanted to know if there is anything related to the end point of a string to distinguish with?
Regards,
Gokul
ppr
(Peter)
2
YourStringVar.ToUpper.EndsWith(“.PDF”)
2 Likes
Gokul001
(Gokul Balaji)
3
Hi @gokul1904
How about this express?
Directory.GetFiles(Environment.CurrentDirectory+"\Input\","*.pdf").Tostring
This expression will get only the PDF file inside the folder. Just give the Path
Regards
Gokul
1 Like
Hello @gokul1904 ,
You can use : YourStringVar.Split("."c).LastOrDefault.equals(“pdf”)
Regards,
Rohith
1 Like
ppr
(Peter)
6
As an alternate also have a look at:
1 Like
system
(system)
Closed
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.