utils.java

来自「自动生成JAVA-Struts网站的程序」· Java 代码 · 共 43 行

JAVA
43
字号
package com.sutternow.misc;/** * Created by IntelliJ IDEA. * User: sergei * Date: May 2, 2003 * Time: 6:48:24 PM * To change this template use Options | File Templates. */public class Utils {    public static String parseNull(String str) {        if (str==null) {            return "";        } else return str;     }    //{{{ replaceString() method public static String replaceString(String aSearch, String aFind, String aReplace) { /* MP could not get regex replace to work. so I am including this function for now */ String result = aSearch; if (result != null && result.length() > 0) {     int a = 0;     int b = 0;     while (true) {         a = result.indexOf(aFind, b);         if (a != -1) {             result = result.substring(0, a) + aReplace + result.substring(a + aFind.length());             b = a + aReplace.length();         }         else         break;     } } return result; } //}}}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?