有什么方法可以转换这样的请求:
"Annotation text="President Obama called Wednesday on Congress to extend a tax break
for students included in last year's economic stimulus package, arguing that the policy
provides more generous assistance."
confidence="0.2" support="20"
sparql="SELECT DISTINCT ?x WHERE { ?x a <http://dbpedia.org/ontology/OfficeHolder>; .
?x ?related <http://dbpedia.org/resource/Chicago>; }"
policy="whitelist"
进入这个?
我知道空格等于 %20,但我不知道其他转换。 有没有Java库可以进行转换?
最佳答案
使用
URLEncoder.encode(textAfterQuestionMark);
关于java - 将文本转换为 URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8589598/