½ØÈ¡×Ö·û´®(ÖÐÓ¢»ìºÏ´®) JAVA´úÂë
public class SplitString {
/**
* @param args
*/
public static void main(String[] args) {
String str = "ÖÐZellÖйú5000Äê,Congruations!";
int bytes = 8;
str = new SplitString().getSubString(str, bytes);
System.out.println(str);
}
public String getSubString(String str,int bytes){
int temp = bytes;
byte [] AllBytes = str.getBytes();
int AllStrByteLen = AllBytes.length;
if(bytes > AllStrByteLen | bytes <= 0){
return str;
}
int ChinaWordsNum = 0;
for(int i=0;i<temp;i++){
int IntOfByte = (int)AllBytes[i];
if(IntOfByte < 0 ){
ChinaWordsNum+=1;
}
}
if(ChinaWordsNum%2 == 0){
return new String(AllBytes,0,temp);
}else{
if(bytes == 1){
return null;
}
&
Ïà¹ØÎĵµ£º
import java.io.*;
public class Test {
public static String convert(String s) {
if (s == null || s.length() == 0)
return s;
  ......
ת×Ô£ºhttp://tieba.baidu.com/f?kz=692446591
ÔõôѧϰJava£¬ÕâÊǺܶàÐÂÊÖ¾³£»áÎÊÎÒµÄÎÊÌ⣬ÏÖÔÚÎÒ¼òµ¥ÃèÊöÏÂÒ»¸öJava³õѧÕßµ½¾ÍҵҪѧµ½µÄһЩ¶«Î÷£º
Ê×ÏÈÒªÃ÷°×JavaÌåϵÉè¼Æµ½µÃÈý¸ö·½Ã棺J2SE,J2EE,J2ME£¨KJAVA£©¡£J2SE£¬Java 2 Platform Standard Edition£¬ÎÒÃǾ³£Ëµµ½µÄJDK£¬¾ÍÖ÷ÒªÖ¸µÄÕâ¸ö£ ......
±äÁ¿£º´æ´¢Êý¾ÝµÄ»ù±¾µ¥Ôª£»Ò»¸öÊý¾Ý´æ´¢¿Õ¼äµÄ±íʾ.
»ù±¾Êý¾ÝÀàÐÍ(8ÖÖ)£º
byte(1)-->short(2)-->int(4)-->long(8) float(4)-->double(8) boolean(1) char(2)
ÒýÓÃÊý¾ÝÀàÐÍ£º
String¡¢Êý×é¡¢Àà¡¢½Ó¿Ú¡¢¶ÔÏó ......
1.
BufferedReader in = new BufferedReader(new FileReader("Ô¶³ÌÎļþ"));
in.readLine() ;
l ʹÓà Java ²Ù×÷Îı¾ÎļþµÄ·½·¨Ïê½â
http://java.ccidnet.com/art/3737/20041108/523627_1.html
l FileReader ÊÇʲôÀࣿºÍ FileInputStream ÓÐʲô²»Í¬£¿£¿£¿
ht ......
×ÔJava2ÒÔÀ´£¬JavaÓïÑÔÔö¼ÓÁËÒ»¸ö¹Ø¼ü×Östrictfp£¬ËäÈ»Õâ¸ö¹Ø¼ü×ÖÔÚ´ó¶àÊý³¡ºÏ±È½ÏÉÙÓ㬵«ÊÇ»¹ÊÇÓбØÒªÁ˽âһϡ£
strictfp µÄÒâ˼ÊÇFP-strict£¬Ò²¾ÍÊÇ˵¾«È·¸¡µãµÄÒâ˼¡£ÔÚJavaÐéÄâ»ú½øÐи¡µãÔËËãʱ£¬Èç¹ûûÓÐÖ¸¶¨strictfp¹Ø¼ü×Öʱ£¬JavaµÄ±àÒëÆ÷ÒÔ¼°ÔËÐл·¾³ÔÚ¶Ô¸¡µãÔËËãµÄ±í´ïʽÊDzÉȡһÖÖ½üËÆÓÚÎÒÐÐÎÒËØµÄÐÐΪÀ´Íê³É ......