variable.ToString.ToLower.Contains("pdf")

Hi,

I had include the statement above in the if’s condition. If the url contains “pdf” then it do A, else it do B.
But some url that contains “pdf” it do B too.

How to solve this problem?

Thank you and best regards.

@teo_choudu Can you show the URL’s in text ?

Use trim option and check

Variable.Tostring.Trim.ToLower.Contains(“pdf”)

Why Pdf comes in URL ?

Can you share the Requirement pls?

3 Likes

Variable.ToString.Trim.ToLower.Contains(“pdf”) not work for that url.

@teo_choudu Ok, Try with this Expression:
Split(Split(Variable,"/")(Split(Variable,"/").Count-1),".")(1).ToLower.Equals(“pdf”)

you can use - fileURL.Trim.ToLower.Contains(".pdf")
FileCheck.xaml (4.7 KB)

This does not work too.

This does not work for other url

@teo_choudu What are the Other URL types? Please provide each different URL types present for your case, It will make us easy to Suggest a Solution for that.



https://aseanbasketballleague.com/tings-turn-erupt-malaysia-wins-second-straight-game-chung-chou-university/

https://www.supremecourt.gov.sg/hearing/hearing-list





http://eprints.um.edu.my/view/creators/Teo=3AW=2ED=2E=3A=3A.html
https://www.nature.com/articles/s41598-018-33976-w

It can be any type of url

@teo_choudu Ok, I guess It was because It didn’t have “pdf” in it right?
What error did it Give?

press_release_2017_bursa_excellence_awards.pdf

But for the link above, even though it have “pdf” but it cant read the word “pdf” and return a result false and did the sequence in else.

@teo_choudu Check this workflow :
Pass your URL’s to the Variable URLs in the Assign Activity. It Will Determine if it’s a Pdf or not
TextManipulationTest.zip (13.8 KB)

It works and thank you.

How if I want to search not only “pdf” but also “ATTACHMENTS”?

Can you help?

Thank you and best regards.

@teo_choudu You want to Search if there is “pdf” in Url and also if “ATTACHMENTS” in Url?

Yes. Either one.

@teo_choudu Which URL contains Attachments in it?Can you Share that url example?

http://disclosure.bursamalaysia.com/FileAccess/apbursaweb/download?id=183421&name=EA_DS_ATTACHMENTS