Tag: 包含预览模式: 普通 | 列表
09-07
16

判断一个String中是否包含另一个String

老了,什么都想不起来了唉

String   str="I   am   a   student";  
  if(str.indexOf("am   a")   >   0)  
    return   true;  
  else  
    return   false;

查看更多...

Tags: 包含 String

分类:Java&Jsp | 固定链接 | 评论: 1 | 引用: 0 | 查看次数: 281
09-04
06

关于between and包含一段问题

执行下面的HQL语句,发现3月31日的记录无法查询到,百思不得其解。
引用内容 引用内容
select count(a.click) from Article as a where  (a.sendTime between '2009-03-01' and '2009-03-31') and a.admin=56 and (a.state=1)


后来发现数据库是以03月31日00:00:00为截止点,所以需要修改为:
引用内容 引用内容
select count(a.click) from Article as a where  (a.sendTime between '2009-03-01' and '2009-03-31 23:59:59') and a.admin=56 and (a.state=1)

查看更多...

Tags: between 包含

分类:Database | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 448
08-03
07

判断是否包含相应字符串

引用内容 引用内容
string   father="welcome   you   to   come   here";  
string   child   ="you";  

if(father.indexOf(child)>=0){  
      ...   ...  
}

查看更多...

Tags: 包含 indexOf

分类:学习 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 433