How to check that a uri string is valid

后端 未结 5 1716
轻奢々
轻奢々 2020-12-01 08:32

How do you check that a uri string is valid (that you can feed it to the Uri constructor)?

So far I only have the following but for obvious reasons I\'d prefer a les

5条回答
  •  情深已故
    2020-12-01 09:27

    In your case the uri argument is an absolute path which refers to a file location, so as per the doc of the method it returns false. Refer to this

提交回复
热议问题