?? finalvar.java
字號:
package huitong.util;
public class FinalVar
{
public static String rootPath ="D:\\java\\Tomcat 6.0\\webapps\\photo\\_userRoot\\";
public static int compare(String str1,String str2)
{ //str1 > str2 return 1;
//str1 == str2 return 0;
//str1 < str2 return -1;
//前iShorter個字符相等,如果str1已經結束,返回1;str2結束,返回-1;都結束返回0
int iShorter = str1.length();
int returnValue = 0;
if (str2.length() > iShorter )
{//
iShorter = str2.length();
returnValue = 1;
}
if (str2.length() < iShorter )
{
iShorter = str2.length();
returnValue = -1;
}
int index = 0;
for (;index < iShorter;index++)
{
if (str1.charAt(index) < str2.charAt(index))
{
returnValue = -1;
break;
}
if (str1.charAt(index) > str2.charAt(index)){}
{
returnValue = 1;
break;
}
}
return returnValue;
}
public static String encoding(String str)
{
try
{
str = new String(str.getBytes("iso-8859-1"));
}
catch(Exception e)
{
e.printStackTrace();
}
return str;
}
public static String subFourChars(String str)
{
if (str.length() > 4)
{
str = str.substring(0,4);
}
return str;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -