Parsing a URL in Java

前端 未结 4 1938
我寻月下人不归
我寻月下人不归 2021-01-20 16:32

I am looking for an equivalent to PHP\'s \"parse_url\" function in Java. I am not running in Tomcat. I have query strings saved in a database that I\'m trying to b

4条回答
  •  鱼传尺愫
    2021-01-20 16:55

    No such thing in Java. You will need to parse the strings manually and create your own array. You could create your own parse_url using StringTokenizer, String.split, or Regular Expressions rather easily.

    You could also cast those strings from the database back to URL objects and parse them that way, here are the docs.

提交回复
热议问题