TextView tv = (TextView)findViewById(R.id.tv);
String str ="我要变成红色字体,红色字体,红色字体";
String[] str2 ={"我","变","红"};
tv.setText(turnSomeWordsToRed(str,str2));
public SpannableStrin...
分类:
移动开发 时间:
2014-06-29 07:35:39
阅读次数:
215
// 生成订单号 public static String setRandomChar() {
String str = ""; for (int i = 0; i < 10; i++) { int ch = (int) (10 * (Math...
分类:
其他好文 时间:
2014-06-11 12:07:04
阅读次数:
262
/** * ajax responseTEXT write; * @param request *
@param response * @param str */ public static void response(HttpServletReque...
分类:
Web程序 时间:
2014-06-11 11:35:20
阅读次数:
226
//get 发送短信 public static String send_sms(String
mobile_phone, String msg) { String ret_str = ""; BufferedReader rd=null; try
{...
分类:
其他好文 时间:
2014-06-11 11:31:29
阅读次数:
216
/** * 查询短信的短信剩余条数 * @return */ public static String
getSmsCount() { String ret_str = ""; BufferedReader rd=null; t...
分类:
其他好文 时间:
2014-06-11 11:24:42
阅读次数:
359
char a[] = "hello";string s =
"hello";cout<<sizeof(a)<<endl;cout<<sizeof(s)<<endl;cout<<sizeof(s.c_str())<<endl;
输出为6324最后一个c_str返回的是char*,所有指针的长度都为4....
分类:
其他好文 时间:
2014-06-11 10:31:16
阅读次数:
234
基本数据类型都有自己的包装对象:如 String 、Number、Boolean包装对象如何来: 因为
str有它的包装对象Sting对象,过程是基本类型会找到对应的包装对象类型,然后把包装对象的属性和方法继续过来,最后包装对象消失,所以str.charAt(0);可以正常使用.原型链:实例对象与原...
分类:
其他好文 时间:
2014-06-11 09:01:43
阅读次数:
237
1、求一串字符串中连续出现次数最多的字串
#include#include#includeusing namespace std;pair fun(const string &str){
vector substrs; int maxcount=1,count=1; string substr; i...
分类:
其他好文 时间:
2014-06-10 00:18:57
阅读次数:
266
freemarker字符串拼接1、字符串拼接的几种类型(1)字符串和字符串(2)字符串和数字(3)字符串和字符串变量(4)字符串变量和字符串变量2、演示演示样例${str}
${"您好," + "李思思"} ${"您好,你今年年龄是:" + 20}${10 + "岁"} ...
分类:
其他好文 时间:
2014-06-08 06:35:13
阅读次数:
224
之前美丽湾项目是用赢家写的替换方法,替换数据时,无法深度遍历,这里修改一下方法: 1
function tempExt(h, data) { 2 return h.replace(/\{(.*?)\}/g, function (str, m) {
3 ...
分类:
其他好文 时间:
2014-06-07 23:05:37
阅读次数:
231