在开发中我们一般要使用字符串格式化拼接,使用StringBuilder拼接字符最好不过了,话不多说,直接上代码示例,很简单,创建字符串对象,添加就好。
public static String effectTimeUrlSplicing(String time){
StringBuilder sb=new StringBuilder();
sb.append("https://www.fema.gov/api/open/v1/chivedAlerts?$inlinecount=allpages&$filter=sent%20gt%20%27");
sb.append(time);
sb.append(".000Z%27%20and%20(");
sb.append(VariableSorting.mPosionStr);
sb.append(")%20and%20(");
sb.append(VariableSorting.mEventStr);
sb.append(")&$top=150");
return sb.toString();
}版权声明:本文为Blue_Tong原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。