javaÕýÔò±í´ïʽȥµôÆ¥Åä¿Õ¸ñ¿ÕÐÐ
java µÄÈ¥µô¿Õ¸ñ¿ÕÐеÄÀý×Ó£º
String so = "haolong, hei eip, "
+"ting, " +
" oo|,"
+" ";
System.out.println(so.length());
// so.replaceAll("(\n|\r\n)\\s*", ""); ²âÊÔÊDz»¿ÉÒÔ
//[\s\p{Zs}]Õâ¸ö¿ÉÒÔ£¬ÒªÍ¬Ê±Æ¥Åä \s ÒÔ¼°¸÷ÖÖÆäËûµÄ¿Õ°××Ö·û£¨°üÀ¨È«½Ç¿Õ¸ñµÈ£©£¬¿ÉÒÔʹÓÃ
Pattern pattern = Pattern.compile("[\\s\\p{Zs}]");
Matcher re = pattern.matcher(so);
so=re.replaceAll("");
// so.replace("(\\r\\n)+|\\n+|\\s+","");²âÊÔÊDz»¿ÉÒÔ
// so.replaceAll("(\n|\r\n)\\s*", "");²âÊÔÊDz»¿ÉÒÔ
// so.replaceAll("(\n|\r\n)\\s+", "$1");²âÊÔÊDz»¿ÉÒÔ
System.out.println(so.length());
System.out.println(so);
"\s"Æ¥ÅäµÄÊÇÄÄÒ»ÖÖ¿Õ¸ñ?
\sÆ¥ÅäÈÎÒâµÄ¿Õ°×·û£¬°üÀ¨¿Õ¸ñ£¬ÖƱí·û(Tab)£¬»»Ðзû£¬ÖÐÎÄÈ«½Ç¿Õ¸ñ
\s ¿Õ°××Ö·û£º[ \t\n\x0B\f\r] //Õâ¸öÊÇÖØµã£¡
\t ÖÆ±í·û ('\u0009')
\n ÐÂÐУ¨»»ÐУ©·û ('\u000A')
\r »Ø³µ·û ('\u000D')
\f »»Ò³·û ('\u000C')
\a ±¨¾¯ (bell) ·û ('\u0007')
\e תÒå·û ('\u001B')
\cx ¶ÔÓ¦ÓÚ x µÄ¿ØÖÆ·û
\s ²¢²»ÄÜÆ¥ÅäÖÐÎÄÈ«½Ç¿Õ¸ñ¡£
\s
Ïà¹ØÎĵµ£º
ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1 List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......
ÎÒÏÖÔÚÊÇ´ó¶þµÄѧÉú£¬Ñ§µÄÊǵç×ÓÉÌÎñרҵ£¬¿¼Âǵ½ÏÖÔÚ¾ÍҵѹÁ¦´ó£¬ËùÒÔ¾Í×Ô¼º×ÔѧÁËJava£¬ÒÔºóÏëÍùJava³ÌÐòÔ±·½Ïò·¢Õ¹£¬ÕâÒ²¸ø×Ô¼º¶àÌõ³ö·£¬ÏÖÔÚJava SE ¿ìѧÍêÁË£¬µ«ÊDz»ÐÒµÄÊÇÎÒÏÝÈëÁËÉîÉîµÄ¿àÄÕÖУ¬ÄǾÍÊÇѧÁ˺óÃæ£¬×ÜÍü¼ÇÇ°Ãæ£¬ÎÒÏÖÔÚѧµ½ÁËGUI±à³Ì£¬ÂíÉϾÍÒª¶¯ÊÖ¿ªÊ¼ÏîÄ¿ÁË£¬¾ÍÊÇÁÄÌ죬 ̹¿Ë´óÕ½µÄÏîÄ¿£¬Ò»Ð´ÏîÄ¿¾Í¸Ð ......
×ܵĸñʽÊÇ£º
%[argument_index$][flags][width][.precision]conversion
ÀýÈ磺
%2$-5.2s
//2$£ºÈ¡µÚ¶þ¸ö²ÎÊý
//-: Ö¸¶¨Îª×ó¶ÔÆë£¬Ä¬ÈÏÓÒ¶ÔÆë
//5£º×î´óÊä³ö¿í¶ÈΪ20,²»¹»»á²¹¿Õ¸ñ£¬Êµ¼ÊÈô³¬¹ýÔòÈ«²¿Êä³ö
//.2£ºÔڴ˱íʾÊä³ö²ÎÊý2µÄ×î´ó×Ö·ûÊýÁ¿£¬Èç¹ûÊǸ¡µãÊý×Ö£¬Ôò±íʾСÊý²¿·ÖÏÔʾµÄλÊý
//s £º±íʾÊäÈë²ÎÊýÊÇ×Ö ......
µÚÒ»½×¶Î£ºJAVA»ù´¡ÔöÇ¿/Oracle+MySqlÊý¾Ý¿â+JDBC¿ª·¢¼¼Êõ+DAO·â×°
ºËÐļ¼Êõ¿Î³Ì
java»ù´¡¼ÓÇ¿£ºÔöÇ¿forÑ»·¡¢¿É±ä²ÎÊý¡¢Ã¶¾Ù¡¢·´Éä¡¢ÄÚÊ¡¡¢beanutils¹¤¾ß¡¢×¢½â¡¢·ºÐÍ¡¢Àà¼ÓÔØ¡¢´úÀí¡¢×°Ïä/²ðÏä¡¢¾²Ì¬ÒýÓõÈJavaм¼ÊõºÍ¸ß¼¶¼¼Êõ¡£
OracleºÍMySqlÊý¾Ý¿â£ºOracleºÍMySqlÊý¾Ý¿â»ù´¡¹ÜÀí¡¢SQL ÓïÑÔ¡¢PL/SQLÓïÑÔ¡¢Êý¾Ý¿âÉ ......
1¡£ÒªÓõ½µÄ°üÓУº
2.json , javaÖ®¼ä»ù±¾ÀàÐ͵Äת»»£¬
StringBuffer sb = new StringBuffer("{'name':'oop'}");
JSONObject jo = JSONObject.fromObject(sb.toString());
Map<String,Object> map = new HashMap<String,Object>();
&nbs ......