*华氏度转摄氏度
℃ = (οF - 32) / 1.8
摄氏度转华氏度
°F = (9/5)*°C + 32
摄氏度转华氏度
fahrenheit = (9/5.0) * wd + 32; fahrenheit2 = (9/5.0) * wd2 + 32; int hs = (int) fahrenheit;
华氏度转摄氏度
degree = (fahrenheit - 32)*5/9;
特殊字符
String tt = "sdfdf{fwe }fwef< fwef #$";String regEx="[`~!@#$%^&*()+=|{}':;'\\[\\].<>/?~!@#¥%……&*()——+|{}【】';:”“’。、?]";
Pattern p = Pattern.compile(regEx);
Matcher m = p.matcher(tt);
String toSpeechText=m.replaceAll("").trim();
Log.i("lgq","ww正则==="+toSpeechText);Pattern pattern = Pattern.compile("\t|\r|\n|\\s*");
Matcher matcher = pattern.matcher(toSpeechText);
String dest = matcher.replaceAll("");Log.i("lgq","ww正则222==="+dest);
04-29 08:58:47.569 14311-14311/com.dlc.mytestttt I/lgq: ww正则===sdfdffwe fwef fwef
04-29 08:58:47.569 14311-14311/com.dlc.mytestttt I/lgq: ww正则222===sdfdffwefweffwef
Android String标签使用,实现组合字符串
<string name="total_price"><![CDATA[
<font color="#666666">共%1$d件商品 小计:</font><font color="#FB6D74">¥%2$s</font>
]]></string>
调用
mTvTotalPrice.setText(Html.fromHtml(getString(R.string.total_price, mGoodsInfo.getBuyNum(), mGoodsInfo.getTotalPrice())));
s代表String类型d代表数字类型
<string name="kedikou">可抵扣%1$s元</string>
调用
mTvDeduction.setText(getString(R.string.kedikou, dikouMoney));
#8195是空格
<string name="pick_up_store">提货门店:%1$s %2$s</string>
调用
textView.setText(getString(R.string.pick_up_store, "第一", "第二二"));