这是我的代码:
for (int i = indexRowStart; i < indexRowEnd; i++) {
Element e = (Element) nl.item(i);
// adding each child node to HashMap key => value
map = new HashMap<String, String>();
map.put("RowID", String.valueOf(RowID));
String Heading = parser.getValue(e, KEY_NAME).replace("|","|\n").replace("|","");
map.put(KEY_NAME, Heading);
}
输出:
30 | Section 120 of the Income-tax Act, 1961 – Jurisdiction of
解析后我得到了这些数据,我想以粗体字母打印 |
之前的字符串,在本例中我想以粗体字母打印 30
。
任何帮助将不胜感激。
最佳答案
尝试 Html.fromHtml 将某些文本设为粗体。
title.setText(Html.fromHtml("<b>30</b> | Section 120 of the Income-tax Act, 1961 – Jurisdiction of"));
关于java - 如何在 "| "之前设置粗体文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12833007/