本文整理汇总了Java中org.apache.commons.lang.StringUtils.indexOfIgnoreCase方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.indexOfIgnoreCase方法的具体用法?Java StringUtils.indexOfIgnoreCase怎么用?Java StringUtils.indexOfIgnoreCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang.StringUtils
的用法示例。
在下文中一共展示了StringUtils.indexOfIgnoreCase方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isLetterAround
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private static boolean isLetterAround(String line, String pattern) {
int start = StringUtils.indexOfIgnoreCase(line, pattern);
int end = start + pattern.length();
boolean pre = start > 0 && Character.isLetter(line.charAt(start - 1));
boolean post = end < line.length() - 1 && Character.isLetter(line.charAt(end));
return pre || post;
}
示例2: freedetail
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@RequestMapping(value = "boarddetail.jy", method = { RequestMethod.POST, RequestMethod.GET })
public String freedetail(JYBoard board, HttpServletRequest request,
HttpServletResponse response, Model model) {
logger.info("Welcome BoardController boarddetail! ---------------------------------------");
Cookie cookies[]=request.getCookies();
Map<String, String> map=new HashMap<>();
if(cookies!=null) {
for (int i = 0; i < cookies.length; i++) {
Cookie tempCookie=cookies[i];
map.put(tempCookie.getName(), tempCookie.getValue());
logger.info("Welcome BoardController boarddetail! -----------------------------------name "+
tempCookie.getName()+" value "+tempCookie.getValue());
}
}
String readCount=map.get("readcount_"+board.getSeq());
String newReadCount="readcount_"+board.getSeq();
if(StringUtils.indexOfIgnoreCase(readCount, newReadCount)==-1) {
Cookie cookie=new Cookie("readcount_"+board.getSeq(),"readcount_"+board.getSeq());
cookie.setMaxAge(24*60*60);
response.addCookie(cookie);
boardService.updateReadcount(board);
}
JYBoardMap bm=new JYBoardMap(boardService.getBoard(board));
request.getSession().setAttribute("bestcategorylist", categoryService.getPopCatList());
request.getSession().setAttribute("categorylist", categoryService.getCatList());
model.addAttribute("boarddetail", bm);
logger.info("Welcome BoardController boarddetail! " + bm);
return "boarddetail.tiles";
}