½ØÈ¡×Ö·û´®(ÖÐÓ¢»ìºÏ´®) 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;
}
&
Ïà¹ØÎĵµ£º
1.JavaÀïÃæʹÓÃ
static
·½·¨ÓÐʲôºÃ´¦£¿
´ð£ºÔÚÏîÄ¿ÖУ¬¶ÔÓÚƵ·±Ê¹Óõķ½·¨£¬Ê¹ÓÃstatic
ÐÞÊλáÌá¸ßЧÂÊÂð£¿
¾²Ì¬·½·¨µÄºÃ´¦¾ÍÊDz»ÓÃÉú³ÉÀàµÄʵÀý¾ÍÄÜÖ±½Óµ÷ÓúͶÔÏóÎÞ¹Ø
Äã²»ÓÃÉú³É¶ÔÏó¾ÍÄÜÓÃÕâ¸ö·½·¨ÁË£¬²»ÊÇÌá¸ßЧÂÊ£¿ÄãÉú³É¶ÔÏóµÃÕ¼ÓÃÄÚ´æ¿Õ¼ä°¡
ÖÁÓÚ¾²Ì¬ÊôÐÔÒ²ÄÜÌá¸ßЧÂÊ£¬ÄãÆÕͨµÄÊôÐÔÿ¸öÀà¶Ô ......
ÔÚjavaÏîÄ¿¼¯³Éflex¿ª·¢ÔÚweb2.0ÊÇÊÇÒ»¸öÊ®·ÖÓмÛÖµµÄ¿ª·¢·½°¸£¬ÌرðÔÚÆóÒµ¼¶µÄÓ¦ÓÃÖУ¬flexºÍjava¼äµÄͨѶԽÏÔÖØÒª¡£µ«ÊÇÏÖÔÚµÄjavaºÍflexµÄ¿ò¼ÜËäÈ»¶à£¬µ«Êǹ²Í¨ÐÔ²»´ó¡£¾ÍÊÇͨ¹ý´«Í³µÄwebserviceµ÷Óã¬Ò²ÒòΪЧÂÊÎÊÌâºÍ½âÎöxmlµÄ·±ÖصŤ×÷£¬ºÜ¶àÏîÄ¿¿ª·¢ËٶȺÍά»¤ÏÞÖƽϴó¡£ÔÚ½üÀ´ÏîÄ¿£¬ÎÒÔÚ¹«Ë¾³¢Ê ......
Ò»¡¢ÏîÄ¿°æ±¾¹æ·¶£º
1¡¢°æ±¾ºÅÃüÃû¸ñʽ£º
V Ö÷°æ±¾ºÅ.´Î°æ±¾ºÅ.ÐÞÕû°æ±¾ºÅ
a£®³õʼ°æ±¾ºÅΪV1.0.0£»
b£®ÀàÊôÐÔ»òÀà·½·¨µÄÄÚÈÝ·¢Éú±ä»¯Ê±£¬Ö÷°æ±¾ºÅºÍ´Î°æ±¾ºÅ¶¼²»±ä£¬ÐÞÕû°æ±¾ºÅ¼Ó 1£»
c£®Ôö¼ÓÁËÀà»ò½Ó¿Ú·½·¨Ê±£¬Ö÷°æ±¾ºÅ²»±ä£¬´Î°æ±¾ºÅ¼Ó 1£¬ÐÞÕû°æ±¾ºÅ¸´Î»Îª0£»
d£®Ôö¼ÓÁËÀà»ò½Ó¿Úʱ£¬Ö÷°æ±¾ºÅ¼Ó1£¬´Î°æ±¾ºÅ¸´Î»Îª0 ......
ϵͳ×Ô¶¯Å׳öµÄÒì³£
ËùÓÐϵͳ¶¨ÒåµÄ±àÒëºÍÔËÐÐÒì³£¶¼¿ÉÒÔÓÉϵͳ×Ô¶¯Å׳ö£¬³ÆΪ±ê×¼Òì³££¬²¢ÇÒ Java Ç¿ÁÒµØÒªÇóÓ¦ÓóÌÐò½øÐÐÍêÕûµÄÒì³£´¦Àí£¬¸øÓû§ÓѺõÄÌáʾ£¬»òÕßÐÞÕýºóʹ³ÌÐò¼ÌÐøÖ´ÐС£
Óï¾äÅ׳öµÄÒì³£
Óû§³ÌÐò×Ô¶¨ÒåµÄÒì³£ºÍÓ¦ÓóÌÐòÌض¨µÄÒì³£,±ØÐë½èÖúÓÚ throws ºÍ throw Óï¾äÀ´¶¨ÒåÅ׳öÒì³£¡£
throwÊÇÓï¾äÅ׳ö ......