<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>代码收藏 &#187; 截取</title> <atom:link href="http://code.9enjoy.com/tag/%e6%88%aa%e5%8f%96/feed/" rel="self" type="application/rss+xml" /><link>http://code.9enjoy.com</link> <description>收集网站开发时常用到的代码(asp,php,js等)，以函数为主</description> <lastBuildDate>Mon, 24 Jan 2011 14:23:49 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.1</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>截取字符串-InterceptString</title><link>http://code.9enjoy.com/asp/interceptstring/</link> <comments>http://code.9enjoy.com/asp/interceptstring/#comments</comments> <pubDate>Wed, 05 Nov 2008 09:27:55 +0000</pubDate> <dc:creator>enjoy</dc:creator> <category><![CDATA[asp]]></category> <category><![CDATA[字符串]]></category> <category><![CDATA[截取]]></category> <category><![CDATA[长度]]></category><guid
isPermaLink="false">http://code.itlearner.com/?p=56</guid> <description><![CDATA['************* 截取字符串 ************** <br/><br/>function InterceptString(txt,length) <br/>txt=trim(txt) <br/>x = len(txt) <br/>y = 0 <br/>if x >= 1 then <br/>for ii = 1 to x <br/>if asc(mid(txt,ii,1)) < 0 or asc(mid(txt,ii,1)) >255 then '如果是汉字 <br/>y = y + 2 <br/>else <br/>y = y + 1 <br/>end if <br/>if y >= length then <br/>...
]]></description> <content:encoded><![CDATA[<p>&#8216;************* 截取字符串 **************</p><p>function InterceptString(txt,length)<br
/> txt=trim(txt)<br
/> x = len(txt)<br
/> y = 0<br
/> if x &gt;= 1 then<br
/> for ii = 1 to x<br
/> if asc(mid(txt,ii,1)) &lt; 0 or asc(mid(txt,ii,1)) &gt;255 then &#8216;如果是汉字<br
/> y = y + 2<br
/> else<br
/> y = y + 1<br
/> end if<br
/> if y &gt;= length then<br
/> txt = left(trim(txt),ii) &#8216;字符串限长<br
/> exit for<br
/> end if<br
/> next<br
/> InterceptString = txt<br
/> else<br
/> InterceptString = &#8220;&#8221;<br
/> end if</p><p>End Function</p> <img
src="http://code.9enjoy.com/?ak_action=api_record_view&id=56&type=feed" alt="" />]]></content:encoded> <wfw:commentRss>http://code.9enjoy.com/asp/interceptstring/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk
Database Caching 6/14 queries in 0.006 seconds using disk

Served from: code.itlearner.com @ 2012-02-07 02:54:03 -->
