﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-为了生活而生活</title><link>http://www.blogjava.net/terry711/</link><description /><language>zh-cn</language><lastBuildDate>Sun, 12 Apr 2026 06:03:08 GMT</lastBuildDate><pubDate>Sun, 12 Apr 2026 06:03:08 GMT</pubDate><ttl>60</ttl><item><title>快速的一年</title><link>http://www.blogjava.net/terry711/archive/2008/02/19/180698.html</link><dc:creator>terryliu</dc:creator><author>terryliu</author><pubDate>Tue, 19 Feb 2008 07:53:00 GMT</pubDate><guid>http://www.blogjava.net/terry711/archive/2008/02/19/180698.html</guid><wfw:comment>http://www.blogjava.net/terry711/comments/180698.html</wfw:comment><comments>http://www.blogjava.net/terry711/archive/2008/02/19/180698.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/terry711/comments/commentRss/180698.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/terry711/services/trackbacks/180698.html</trackback:ping><description><![CDATA[转眼一年过去了，回头看这一年里好象什么都没有留下。不知道干了些什么，不能这样了，现在开始要加油。
<img src ="http://www.blogjava.net/terry711/aggbug/180698.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/terry711/" target="_blank">terryliu</a> 2008-02-19 15:53 <a href="http://www.blogjava.net/terry711/archive/2008/02/19/180698.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>不好的项目演示</title><link>http://www.blogjava.net/terry711/archive/2007/04/14/110554.html</link><dc:creator>terryliu</dc:creator><author>terryliu</author><pubDate>Fri, 13 Apr 2007 16:30:00 GMT</pubDate><guid>http://www.blogjava.net/terry711/archive/2007/04/14/110554.html</guid><wfw:comment>http://www.blogjava.net/terry711/comments/110554.html</wfw:comment><comments>http://www.blogjava.net/terry711/archive/2007/04/14/110554.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/terry711/comments/commentRss/110554.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/terry711/services/trackbacks/110554.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;辛辛苦苦终于在15天内完成了手机网站的建库，编码，设计。没想到在演示的时候出现了bug。导致组里队员丢面子&nbsp;&nbsp; 。下次一定要慎重再慎重<br><br>&nbsp; 不能再出现这种状况了。
<img src ="http://www.blogjava.net/terry711/aggbug/110554.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/terry711/" target="_blank">terryliu</a> 2007-04-14 00:30 <a href="http://www.blogjava.net/terry711/archive/2007/04/14/110554.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>StringUtils </title><link>http://www.blogjava.net/terry711/archive/2007/03/16/104372.html</link><dc:creator>terryliu</dc:creator><author>terryliu</author><pubDate>Fri, 16 Mar 2007 14:32:00 GMT</pubDate><guid>http://www.blogjava.net/terry711/archive/2007/03/16/104372.html</guid><wfw:comment>http://www.blogjava.net/terry711/comments/104372.html</wfw:comment><comments>http://www.blogjava.net/terry711/archive/2007/03/16/104372.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/terry711/comments/commentRss/104372.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/terry711/services/trackbacks/104372.html</trackback:ping><description><![CDATA[
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">处理文本对</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">Java</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">应用来说应该算是家常便饭了，在</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">1.4</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">出现之前，</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">Java</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">自身提供的</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">API</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">非常有限，如</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">String</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">、</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">StringTokenizer</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">、</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">StringBuffer</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">，操作也比较单一。无非就是查找</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">substring</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">、分解、合并等等。到</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">1.4</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">的出现可以说</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">Java</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">的文字处理上了一个台阶，因为它支持</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">regular expression</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">了。这可是个重量级而方便的东东啊，缺点是太复杂，学习起来有一定难度。相较而言，</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">Jakarta Commons</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">提供的</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">StringUtils</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">和</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">WordUtils</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">至今还维持着那种简洁而强大的美，使用起来也很顺手。来看一个例子：</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">
						<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'">package</span>
				</b>
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"> sean.study.jakarta.commons.lang;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'">import</span>
				</b>
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'"> org.apache.commons.lang.StringUtils;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<b style="mso-bidi-font-weight: normal">
						<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'">public</span>
				</b>
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<b style="mso-bidi-font-weight: normal">
								<span style="COLOR: navy">class</span>
						</b> StringUtilsAndWordUtilsUsage {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 1">    </span>
						<b style="mso-bidi-font-weight: normal">
								<span style="COLOR: navy">public</span>
						</b>
						<b style="mso-bidi-font-weight: normal">
								<span style="COLOR: navy">static</span>
						</b>
						<b style="mso-bidi-font-weight: normal">
								<span style="COLOR: navy">void</span>
						</b> main(String[] args) {<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: green; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>// data setup<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>String str1 = <span style="COLOR: blue">""</span>;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>String str2 = <span style="COLOR: blue">" "</span>;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>String str3 = <span style="COLOR: blue">"\t"</span>;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>String str4 = <b style="mso-bidi-font-weight: normal"><span style="COLOR: navy">null</span></b>;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>String str5 = <span style="COLOR: blue">"123"</span>;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>String str6 = <span style="COLOR: blue">"ABCDEFG"</span>;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>String str7 = <span style="COLOR: blue">"It feels good to use <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /?><st1:city w:st="on"><st1:place w:st="on">Jakarta</st1:place></st1:city> Commons.\r\n"</span>;<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: green; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>// check for empty strings<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>System.out.println(<span style="COLOR: blue">"=============================="</span>);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>System.out.println(<span style="COLOR: blue">"Is str1 blank? "</span> + StringUtils.isBlank(str1));<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>System.out.println(<span style="COLOR: blue">"Is str2 blank? "</span> + StringUtils.isBlank(str2));<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>System.out.println(<span style="COLOR: blue">"Is str3 blank? "</span> + StringUtils.isBlank(str3));<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>System.out.println(<span style="COLOR: blue">"Is str4 blank? "</span> + StringUtils.isBlank(str4));<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: green; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>// check for numerics<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>System.out.println(<span style="COLOR: blue">"=============================="</span>);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>System.out.println(<span style="COLOR: blue">"Is str5 numeric? "</span> + StringUtils.isNumeric(str5));<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>System.out.println(<span style="COLOR: blue">"Is str6 numeric? "</span> + StringUtils.isNumeric(str6));<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: green; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>// reverse strings / whole words<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>System.out.println(<span style="COLOR: blue">"=============================="</span>);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>System.out.println(<span style="COLOR: blue">"str6: "</span> + str6);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>System.out.println(<span style="COLOR: blue">"str6 reversed: "</span> + StringUtils.reverse(str6));<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>System.out.println(<span style="COLOR: blue">"str7: "</span> + str7);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>String str8 = StringUtils.chomp(str7);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>str8 = StringUtils.reverseDelimited(str8, <span style="COLOR: blue">' '</span>);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>System.out.println(<span style="COLOR: blue">"str7 reversed whole words : \r\n"</span> + str8);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: green; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>// build header (useful to print log messages that are easy to locate)<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>System.out.println(<span style="COLOR: blue">"=============================="</span>);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>System.out.println(<span style="COLOR: blue">"print header:"</span>);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>String padding = StringUtils.repeat(<span style="COLOR: blue">"="</span>, 50);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>String msg = StringUtils.center(<span style="COLOR: blue">" Customised Header "</span>, 50, <span style="COLOR: blue">"%"</span>);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>Object[] raw = <b style="mso-bidi-font-weight: normal"><span style="COLOR: navy">new</span></b> Object[]{padding, msg, padding};<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>String header = StringUtils.join(raw, <span style="COLOR: blue">"\r\n"</span>);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 2">        </span>System.out.println(header);<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">
						<span style="mso-tab-count: 1">    </span>}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-SIZE: 9pt; FONT-FAMILY: 'Courier New'">}<o:p></o:p></span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">输出的结果如下：</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">==============================</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">Is str1 blank? true</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">Is str2 blank? true</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">Is str3 blank? true</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">Is str4 blank? true</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">==============================</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">Is str5 numeric? true</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">Is str6 numeric? false</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">==============================</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">str6: ABCDEFG</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">str6 reversed: GFEDCBA</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">str7: It feels good to use Jakarta Commons.</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">str7 reversed whole words : </span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">Commons. <st1:city w:st="on"><st1:place w:st="on">Jakarta</st1:place></st1:city> use to good feels It</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">==============================</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">print header:</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">==================================================</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">%%%%%%%%%%%%%%% Customised Header %%%%%%%%%%%%%%%%</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left">
				<span lang="EN-US" style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt; mso-highlight: white">==================================================</span>
				<span lang="EN-US" style="FONT-SIZE: 9pt; COLOR: navy; FONT-FAMILY: 'Courier New'; mso-font-kerning: 0pt">
						<o:p>
						</o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">
						<o:p> </o:p>
				</span>
		</p>
		<p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt">
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">从代码中我们可以大致了解到这个</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">StringUtils</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">类简单而强大的处理能力，从检查空串（对</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">null</span>
				<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Trebuchet MS'; mso-hansi-font-family: 'Trebuchet MS'">的情况处理很得体），到分割子串，到生成格式化的字符串，使用都很简洁，也很直截了当。</span>
				<span lang="EN-US" style="FONT-FAMILY: 'Trebuchet MS'">
						<o:p>
						</o:p>
				</span>
		</p>
<img src ="http://www.blogjava.net/terry711/aggbug/104372.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/terry711/" target="_blank">terryliu</a> 2007-03-16 22:32 <a href="http://www.blogjava.net/terry711/archive/2007/03/16/104372.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>