java ²ð·ÖÓëºÏ²¢×Ö·û´®
ÀýÈ磺һ¸ö×Ö·û´®£º123fsf¶á
¸ÄºóҪΪ£º1%2%3%f%s%f%¶á
´úÂëÈçÏÂ
String a="123fsf¶á";
char[] b=a.toCharArray();//×Ö·û´®²ð·Ö³É×Ö·û
String bb = "";
//×Ö·ûºÏ²¢³É×Ö·û´®
for(int i=0; i<b.length;i++){
if(i == b.length-1){
bb += b[i];
}else{
bb += b[i]+"%";
}
}
System.out.println(bb);
Ïà¹ØÎĵµ£º
java.lang.string.split
split ·½·¨
½«Ò»¸ö×Ö·û´®·Ö¸îΪ×Ó×Ö·û´®£¬È»ºó½«½á¹û×÷Ϊ×Ö·û´®Êý×é·µ»Ø¡£
stringObj.split([separator£¬[limit]])
stringObj
±ØÑ¡Ïî¡£Òª±»·Ö½âµÄ String ¶ÔÏó»òÎÄ×Ö¡£¸Ã¶ÔÏ󲻻ᱻ split ·½·¨Ð޸ġ£
separator
¿ÉÑ¡Ïî¡£×Ö·û´®»ò ÕýÔò±í´ïʽ ¶ÔÏó£¬Ëü±êʶÁË·Ö¸ô×Ö·û´®Ê±Ê¹ÓõÄÊÇÒ»¸ö»¹ÊǶà ......
±¾ÈËÕýÔÚѧϰJava£¬ÄÇЩ֪ʶµã¶¼Ñ§µÃºÜºÃ£¬µ«Ò»µ©ÒªÎÒÓÃËùѧµÄ֪ʶ×ö¸öÏîÄ¿³öÀ´ÎÒ¾ÍÎÞ´ÓÏÂÊÖ£¬²»ÖªµÀ´ÓÄÄÀï×öÆð²ÅºÃ£¡Ò»·½ÃæµÄÔÒòÊÇÎÒµÄÔĶÁÁ¿Ì«ÉÙÁË£¬¶þÕß¾Ñé²»×㣡ÎÒÕý½¹¼±×ÅÔõô¸Ä±äÎÒÕâÖÖ״̬£¬ËùÒÔÏëÕÒЩ×öÏîÄ¿µÄ½Ì²ÄÀ´×Ôѧ£¬µ«Õæ²»ÖªµÀ¸Ã¿´ÄÄЩ½Ì²ÄºÃ£¬ËùÒÔÔÚ´ËÏò¸÷λÏîÄ¿¸ßÊÖÇë½Ì£¬Çë¸øÎÒһЩ½¨Òé»òÍÆ¼ö¸øÎÒһЩ½Ì ......
javaµÄ°²×°
·½·¨Ò»
´ò¿ªÖÕ¶Ë£¬Ö´ÐÐÒÔÏÂÃüÁ»òʹÓÃAdept/ÐÂÁ¢µÃÈí¼þ¹ÜÀíÆ÷£¬ÔÚÆäÖзֱðËÑË÷"sun-java6-jre"ºÍ"sun-java6-jdk"²¢±ê¼Ç°²×°¡£
sudo apt-get install sun-java6-jre
Èç¹û¿Õ¼ä¸»Ô££¬½¨Òé°²×°Ò»¸öJDK¡£
sudo apt-get install sun-java6-jdk
Ìáʾ£º°²×°¹ý³ÌÖÐÐèÒªÄã»Ø´ðÊÇ·ñͬÒâʹÓÃÐÒ飨ÖÕ¶ËÖкìÀ ......
UTF8ת»»³ÉGB2312 µ±ÎÒÃÇÔÚ»ùÓÚHTTPÐÒéµÄJSP»òServletµÄÓ¦ÓÃÖлñÈ¡Êý¾Ý»ò·¢ËÍÇëÇóʱ£¬JVM»á°ÑÊäË͵ÄÊý¾Ý±àÂë³ÉUTF8¸ñʽ¡£Èç¹ûÎÒÃÇÖ±½Ó´ÓHTTPÁ÷ÖÐÌáÈ¡ÖÐÎÄÊý¾Ý£¬ÌáÈ¡µÄ½á¹ûΪ“????”£¨¿ÉÄܸü¶àÎʺţ©£¬Îª×ª»»³ÉÎÒÃÇÄܹ»Àí½âµÄÖÐÎÄ×Ö·û£¬ÎÒÃÇÐèÒª°ÑUTF8ת»»³ÉGB2312£¬½èÖúISO-8859-1±ê×¼±àÂëÄܹ»ÇáÒ×µÄʵÏÖ£¬ÏÂÃæ ......