{"id":483,"date":"2008-02-26T00:00:00","date_gmt":"2008-02-25T16:00:00","guid":{"rendered":"http:\/\/www.strongd.net\/?p=483"},"modified":"2011-07-15T09:42:16","modified_gmt":"2011-07-15T01:42:16","slug":"%e7%b2%be%e7%a2%ba%e7%9a%84%e5%ad%97%e7%ac%a6%e4%b8%b2%e6%88%aa%e5%8f%96%e6%96%b9%e6%b3%95-java","status":"publish","type":"post","link":"https:\/\/www.strongd.net\/?p=483","title":{"rendered":"\u7cbe\u78ba\u7684\u5b57\u7b26\u4e32\u622a\u53d6\u65b9\u6cd5 java"},"content":{"rendered":"<p><P>\u53d1\u5f00\u9879\u76ee\u9700\u8981\uff0c\u5728\u7f51\u4e0a\u627e\u4e86\u5f88\u4e45\u90fd\u6ca1\u6709\u6253\u5230\uff0e\u4e8e\u662f\u81ea\u5df1\u52a8\u624b\u5199\u4e86\u4e00\u4e0b\uff0e\u8d21\u732e\u51fa\u6765\u7ed9\u6709\u9700\u8981\u7684\u4eba\uff0e\u5982\u679c\u6709\u4ec0\u4e48\u95ee\u9898\u53ef\u4ee5\u52a0\u6211\uff2d\uff33\uff2e\uff1astrongkill@yahoo.com.hk\u3000\u8ba8\u8bba\u8ba8\u8bba<\/P><br \/>\n<P><FONT color=#ff0000>\u6e90\u4ee3\u7801\uff1a<\/FONT><\/P><br \/>\n<P>&nbsp;\/**<BR>&nbsp; * \u622a\u53d6\u5b57\u7b26\u4e32\u7684\u524dtargetCount\u4e2a\u5b57\u7b26<BR>&nbsp; * @param str \u88ab\u5904\u7406\u5b57\u7b26\u4e32<BR>&nbsp; * @param targetCount \u622a\u53d6\u957f\u5ea6<BR>&nbsp; * @version 1.1<BR>&nbsp; * @author Strong Yuan<BR>&nbsp; * @return String<BR>&nbsp; *\/<BR>&nbsp;public static String subContentStringOrialBytes(String str,int targetCount){<BR>&nbsp;&nbsp;return subContentStringOrialBytes(str,targetCount,&#8221;&#8230;&#8221;);<BR>&nbsp;}<BR>&nbsp;\/**<BR>&nbsp; * \u83b7\u53d6\u6307\u5b9a\u957f\u5ea6\u5b57\u7b26\u4e32\u7684\u5b57\u8282\u957f<BR>&nbsp; * @param str \u88ab\u5904\u7406\u5b57\u7b26\u4e32<BR>&nbsp; * @param maxlength \u622a\u53d6\u957f\u5ea6<BR>&nbsp; * @author Strong Yuan<BR>&nbsp; * @version 1.1<BR>&nbsp; * @return String<BR>&nbsp; *\/<BR>&nbsp;private static long getStringByteLength(String str,int maxlength){<BR>&nbsp;&nbsp;if(str==null)<BR>&nbsp;&nbsp;&nbsp;return 0;<BR>&nbsp;&nbsp;int tmp_len = maxlength;<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;if(str.length()&lt;maxlength)<BR>&nbsp;&nbsp;&nbsp;tmp_len = str.length();<BR>&nbsp;&nbsp;else if(str.length()&gt;maxlength*2)<BR>&nbsp;&nbsp;&nbsp;tmp_len = maxlength*2;<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;char[] tempchar = str.substring(0, tmp_len).toCharArray();<\/P><br \/>\n<P>&nbsp;&nbsp;int intVariable = 0;<BR>&nbsp;&nbsp;String s1 = null;<BR>&nbsp;&nbsp;for(int i=0;i&lt;tempchar.length &amp;&amp; intVariable&lt;=maxlength;i++){<BR>&nbsp;&nbsp;&nbsp;s1 = String.valueOf(tempchar[i]);<BR>&nbsp;&nbsp;&nbsp;intVariable += s1.getBytes().length;<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;s1= null;<BR>&nbsp;&nbsp;tempchar = null;<BR>&nbsp;&nbsp;return intVariable;<BR>&nbsp;}<BR>&nbsp;\/**<BR>&nbsp; * \u622a\u53d6\u6307\u5b9a\u957f\u5ea6\u7684\u5b57\u7b26\u4e32,\u57fa\u4e8ebytes,\u5373\u662f\u4e2d\u6587\u7684\u957f\u5ea6\u4e3a2,\u82f1\u6587\u4e3a1<BR>&nbsp; * @param str \u88ab\u5904\u7406\u5b57\u7b26\u4e32<BR>&nbsp; * @param targetCount \u622a\u53d6\u957f\u5ea6<BR>&nbsp; * @param more \u540e\u7f00\u5b57\u7b26\u4e32<BR>&nbsp; * @author Strong Yuan<BR>&nbsp; * @version 1.1<BR>&nbsp; * @return<BR>&nbsp; *\/<BR>&nbsp;public static String subContentStringOrialBytes(String str, int targetCount,String more)<BR>&nbsp;{<BR>&nbsp;&nbsp;if (str == null)<BR>&nbsp;&nbsp;&nbsp;return &#8220;&#8221;;<BR>&nbsp;&nbsp;int initVariable = 0;<BR>&nbsp;&nbsp;StringBuffer restr = new StringBuffer();<BR>&nbsp;&nbsp;if (getStringByteLength(str,targetCount) &lt;= targetCount)<BR>&nbsp;&nbsp;&nbsp;return str;<\/P><br \/>\n<P>&nbsp;&nbsp;String s1=null;<BR>&nbsp;&nbsp;byte[] b;<BR>&nbsp;&nbsp;char[] tempchar = str.toCharArray();<BR>&nbsp;&nbsp;for (int i = 0; (i &lt; tempchar.length &amp;&amp; targetCount &gt; initVariable); i++) {<BR>&nbsp;&nbsp;&nbsp;s1 = String.valueOf(tempchar[i]);<BR>&nbsp;&nbsp;&nbsp;b = s1.getBytes();<BR>&nbsp;&nbsp;&nbsp;initVariable += b.length;<BR>&nbsp;&nbsp;&nbsp;restr.append(tempchar[i]);<BR>&nbsp;&nbsp;}<\/P><br \/>\n<P>&nbsp;&nbsp;if (targetCount == initVariable || (targetCount == initVariable &#8211; 1)) {<BR>&nbsp;&nbsp;&nbsp;restr.append(more);<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;return restr.toString();<BR>&nbsp;}<BR>&nbsp;\/**<BR>&nbsp; * \u622a\u53d6\u6307\u5b9a\u957f\u5ea6\u7684\u5b57\u7b26\u4e32,\u5b58\u5728\u95ee\u9898,\u4f46\u6548\u7387\u4f1a\u9ad8\u4e00\u70b9\u70b9.just a little <BR>&nbsp; * @param str \u88ab\u5904\u7406\u5b57\u7b26\u4e32<BR>&nbsp; * @param targetCount \u622a\u53d6\u957f\u5ea6<BR>&nbsp; * @param more \u540e\u7f00\u5b57\u7b26\u4e32<BR>&nbsp; * @version 1.1<BR>&nbsp; * @author Strong Yuan<BR>&nbsp; * @return String<BR>&nbsp; *\/<BR>&nbsp;public static String subContentStringOrial(String str,int targetCount){<BR>&nbsp;&nbsp;return subContentStringOrial(str,targetCount,&#8221;&#8230;&#8221;);<BR>&nbsp;}&nbsp;<BR>&nbsp;\/**<BR>&nbsp; * \u622a\u53d6\u6307\u5b9a\u957f\u5ea6\u7684\u5b57\u7b26\u4e32,\u5b58\u5728\u95ee\u9898,\u4f46\u6548\u7387\u4f1a\u9ad8\u4e00\u70b9\u70b9.just a little <BR>&nbsp; * @param str \u88ab\u5904\u7406\u5b57\u7b26\u4e32<BR>&nbsp; * @param targetCount \u622a\u53d6\u957f\u5ea6<BR>&nbsp; * @param more \u540e\u7f00\u5b57\u7b26\u4e32<BR>&nbsp; * @author Strong Yuan<BR>&nbsp; * @return String<BR>&nbsp; *\/<BR>&nbsp;public static String subContentStringOrial(String str, int targetCount,String more)<BR>&nbsp;{<BR>&nbsp;&nbsp;if (str == null)<BR>&nbsp;&nbsp;&nbsp;return &#8220;&#8221;;<BR>&nbsp;&nbsp;int initVariable = 0;<BR>&nbsp;&nbsp;StringBuffer restr = new StringBuffer();<BR>&nbsp;&nbsp;if (str.length() &lt;= targetCount)<BR>&nbsp;&nbsp;&nbsp;return str;<\/P><br \/>\n<P>&nbsp;&nbsp;String s1=null;<BR>&nbsp;&nbsp;byte[] b;<BR>&nbsp;&nbsp;char[] tempchar = str.toCharArray();<BR>&nbsp;&nbsp;for (int i = 0; (i &lt; tempchar.length &amp;&amp; targetCount &gt; initVariable); i++) {<BR>&nbsp;&nbsp;&nbsp;s1 = String.valueOf(tempchar[i]);<BR>&nbsp;&nbsp;&nbsp;b = s1.getBytes();<BR>&nbsp;&nbsp;&nbsp;initVariable += b.length;<BR>&nbsp;&nbsp;&nbsp;restr.append(tempchar[i]);<BR>&nbsp;&nbsp;}<\/P><br \/>\n<P>&nbsp;&nbsp;if (targetCount == initVariable || (targetCount == initVariable &#8211; 1)) {<BR>&nbsp;&nbsp;&nbsp;restr.append(more);<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;return restr.toString();<BR>&nbsp;}<\/P><br \/>\n<DIV><FONT color=#ff0000>\u4e0b\u9762\u662f\u6027\u80fd\u6d4b\u8bd5\uff1a<\/FONT><\/DIV><br \/>\n<DIV><FONT color=#ff0000><\/FONT>&nbsp;<\/DIV><br \/>\n<DIV>public static void main(String[] args){<\/DIV><br \/>\n<DIV>&nbsp;&nbsp;int maxLength = 28;&nbsp;&nbsp;<BR>&nbsp;&nbsp;String str =&#8221;\u5f53\u5965\u8fd0\u5723\u706b\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u957f\u5ea6\uff0c\u8d85\u51fa\u90e8\u5206\u663e\u793a\u7701\u7565\u53f7,\u533a\u5206\u6c49\u5b57\u8ddf\u5b57\u6bcd\u3002\u6c49\u5b572\u4e2a\u5b57\u8282\uff0c\u5b57\u6bcd\u6570\u5b57\u4e00\u4e2a\u5b57\u8282&#8221;;<\/DIV><br \/>\n<DIV>&nbsp;&nbsp;long curr = System.currentTimeMillis();<BR>&nbsp;&nbsp;String aa = null;<BR>&nbsp;&nbsp;for(int i =0;i&lt;=100000;i++){<BR>&nbsp;&nbsp;&nbsp;aa = htmlFilter.subContentStringOrial(str, maxLength);<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;System.out.println(&#8220;\u7ed3\u679c: &#8220;+aa);<BR>&nbsp;&nbsp;System.out.println(&#8220;\u8017\u65f6: &#8221; + (System.currentTimeMillis()-curr)+&#8221; ms&#8221;);<BR>&nbsp;<BR>&nbsp;&nbsp;curr = System.currentTimeMillis();<BR>&nbsp;&nbsp;for(int i =0;i&lt;=100000;i++){<BR>&nbsp;&nbsp;&nbsp;aa = htmlFilter.subContentStringOrialBytes(str, maxLength);<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;System.out.println(&#8220;\u7ed3\u679c: &#8220;+aa);&nbsp;&nbsp;<BR>&nbsp;&nbsp;System.out.println(&#8220;\u8017\u65f6: &#8221; + (System.currentTimeMillis()-curr)+&#8221; ms&#8221;);<BR>&nbsp;&nbsp;<\/DIV><br \/>\n<DIV>&nbsp;&nbsp;System.out.println(htmlFilter.subContentStringOrial(&#8220;[\u539f\u521b]\u5c71\u897f\u4e34\u6c7e\u77ff\u96be3\u4e3b\u72af\u88ab\u5224\u65e0\u671fdfasdfasdfasdf\u4e07\u4eba\u542c\u5224&#8221;, maxLength));<BR>&nbsp;&nbsp;System.out.println(htmlFilter.subContentStringOrialBytes(&#8220;[\u539f\u521b]\u5c71\u897f\u4e34\u6c7e\u77ff\u96be3\u4e3b\u72af\u88ab\u5224\u65e0\u671fdfasdfasdfasdf\u4e07\u4eba\u542c\u5224&#8221;, maxLength,&#8221;&#8230;&#8221;));<BR>&nbsp;&nbsp;\/\/\u5b58\u5728\u95ee\u9898,\u5f53str.length()\u5c0f\u4e8emaxLength\u65f6,\u5c31\u4e0d\u8fdb\u884c\u622a\u53d6<BR>&nbsp;&nbsp;System.out.println(htmlFilter.subContentStringOrial(&#8220;[\u539f\u521b]\u5c71\u897f\u4e34\u6c7e\u77ff\u96be3\u4e3b\u72af\u88ab\u5224\u65e0\u671f\u4e07\u4eba\u542c\u5224&#8221;, maxLength));<BR>&nbsp;&nbsp;System.out.println(htmlFilter.subContentStringOrialBytes(&#8220;[\u539f\u521b]\u5c71\u897f\u4e34\u6c7e\u77ff\u96be3\u4e3b\u72af\u88ab\u5224\u65e0\u671f\u4e07\u4eba\u542c\u5224&#8221;, maxLength,&#8221;&#8230;&#8221;));<\/DIV><br \/>\n<DIV>}<\/DIV><br \/>\n<DIV>&nbsp;<\/DIV><br \/>\n<DIV><FONT color=#ff0000>\u6700\u540e\u8f93\u51fa\u7ed3\u679c\uff1a<\/FONT><\/DIV><br \/>\n<DIV>&nbsp;<\/DIV><br \/>\n<DIV>\u7ed3\u679c: \u5f53\u5965\u8fd0\u5723\u706b\u683c\u5f0f\u5316\u5b57\u7b26<BR>\u8017\u65f6: 1183 ms<BR>\u7ed3\u679c: \u5f53\u5965\u8fd0\u5723\u706b\u683c\u5f0f\u5316\u5b57\u7b26<BR>\u8017\u65f6: 1834 ms<BR>[\u539f\u521b]dfasdfasdfasdf<BR>[\u539f\u521b]dfasdfasdfasdf<BR>[\u539f\u521b]\u5c71\u897f\u4e34\u6c7e\u77ff\u96be3\u4e3b<BR>[\u539f\u521b]\u5c71\u897f\u4e34\u6c7e\u77ff\u96be3\u4e3b<BR>[\u539f\u521b]\u5c71\u897f\u4e34\u6c7e\u77ff\u96be3\u4e3b\u72af\u88ab\u5224\u65e0\u671f\u4e07\u4eba\u542c\u5224\u5224\u65e0\u671f\u4e07\u4eba\u542c\u5224<BR>[\u539f\u521b]\u5c71\u897f\u4e34\u6c7e\u77ff\u96be3\u4e3b<BR><\/DIV><BR><br \/>\n<DIV><\/DIV><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53d1\u5f00\u9879\u76ee\u9700\u8981\uff0c\u5728\u7f51\u4e0a\u627e\u4e86\u5f88\u4e45\u90fd\u6ca1\u6709\u6253\u5230\uff0e\u4e8e\u662f\u81ea\u5df1\u52a8\u624b\u5199\u4e86\u4e00\u4e0b\uff0e\u8d21\u732e\u51fa\u6765\u7ed9\u6709\u9700\u8981\u7684\u4eba\uff0e\u5982\u679c\u6709\u4ec0\u4e48\u95ee\u9898\u53ef\u4ee5\u52a0\u6211\uff2d\uff33\uff2e\uff1astrongkill@yahoo.com.hk\u3000\u8ba8\u8bba\u8ba8\u8bba \u6e90\u4ee3\u7801\uff1a &nbsp;\/**&nbsp; * \u622a\u53d6\u5b57\u7b26\u4e32\u7684\u524dtargetCount\u4e2a\u5b57\u7b26&nbsp; * @param str \u88ab\u5904\u7406\u5b57\u7b26\u4e32&nbsp; * @param targetCount \u622a\u53d6\u957f\u5ea6&nbsp; * @version 1.1&nbsp; * @author Strong Yuan&nbsp; * @return String&nbsp; *\/&nbsp;public static String subContentStringOrialBytes(String str,int targetCount){&nbsp;&nbsp;return subContentStringOrialBytes(str,targetCount,&#8221;&#8230;&#8221;);&nbsp;}&nbsp;\/**&nbsp; * \u83b7\u53d6\u6307\u5b9a\u957f\u5ea6\u5b57\u7b26\u4e32\u7684\u5b57\u8282\u957f&nbsp; * @param str \u88ab\u5904\u7406\u5b57\u7b26\u4e32&nbsp; * @param maxlength \u622a\u53d6\u957f\u5ea6&nbsp; * @author Strong Yuan&nbsp; * @version 1.1&nbsp; * @return String&nbsp; *\/&nbsp;private static long getStringByteLength(String str,int &hellip; <a href=\"https:\/\/www.strongd.net\/?p=483\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">\u7cbe\u78ba\u7684\u5b57\u7b26\u4e32\u622a\u53d6\u65b9\u6cd5 java<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[108],"class_list":["post-483","post","type-post","status-publish","format-standard","hentry","category-java","tag-108"],"_links":{"self":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/483","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=483"}],"version-history":[{"count":1,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/483\/revisions"}],"predecessor-version":[{"id":887,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/483\/revisions\/887"}],"wp:attachment":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}