<?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>The Townes &#187; join和split</title>
	<atom:link href="https://thetownes.coolpage.biz/?feed=rss2&#038;tag=join%E5%92%8Csplit" rel="self" type="application/rss+xml" />
	<link>https://thetownes.coolpage.biz</link>
	<description>本站已转移至：http://www.thetownes.info</description>
	<lastBuildDate>Thu, 01 Aug 2013 11:49:56 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.2</generator>
		<item>
		<title>python join 和 split的常用使用方法</title>
		<link>https://thetownes.coolpage.biz/?p=484</link>
		<comments>https://thetownes.coolpage.biz/?p=484#comments</comments>
		<pubDate>Thu, 01 Aug 2013 11:49:56 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[join和split]]></category>

		<guid isPermaLink="false">http://thetownes.coolpage.biz/?p=484</guid>
		<description><![CDATA[python join 和 split方法的使用,join用来连接字符串，spl &#8230; <a href="https://thetownes.coolpage.biz/?p=484">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>python join 和 split方法的使用,join用来连接字符串，split恰好相反，拆分字符串的。</p>
<div>1.join用法示例&nbsp;</div>
<div>&gt;&gt;&gt;li = ['my','name','is','bob']&nbsp;</div>
<div>&gt;&gt;&gt;&#8217; &#8216;.join(li)&nbsp;</div>
<div>&#8216;my name is bob&#8217;&nbsp;</div>
<div>&nbsp;</div>
<div>&gt;&gt;&gt;&#8217;_&#8217;.join(li)&nbsp;</div>
<div>&#8216;my_name_is_bob&#8217;&nbsp;</div>
<div>&nbsp;</div>
<div>&gt;&gt;&gt; s = ['my','name','is','bob']&nbsp;</div>
<div>&gt;&gt;&gt; &#8216; &#8216;.join(s)&nbsp;</div>
<div>&#8216;my name is bob&#8217;&nbsp;</div>
<div>&nbsp;</div>
<div>&gt;&gt;&gt; &#8216;..&#8217;.join(s)&nbsp;</div>
<div>&#8216;my..name..is..bob&#8217;&nbsp;</div>
<div>&nbsp;</div>
<div>2.split用法示例&nbsp;</div>
<div>&gt;&gt;&gt; b = &#8216;my..name..is..bob&#8217;&nbsp;</div>
<div>&nbsp;</div>
<div>&gt;&gt;&gt; b.split()&nbsp;</div>
<div>['my..name..is..bob']&nbsp;</div>
<div>&nbsp;</div>
<div>&gt;&gt;&gt; b.split(&#8220;..&#8221;)&nbsp;</div>
<div>['my', 'name', 'is', 'bob']&nbsp;</div>
<div>&nbsp;</div>
<div>&gt;&gt;&gt; b.split(&#8220;..&#8221;,0)&nbsp;</div>
<div>['my..name..is..bob']&nbsp;</div>
<div>&nbsp;</div>
<div>&gt;&gt;&gt; b.split(&#8220;..&#8221;,1)&nbsp;</div>
<div>['my', 'name..is..bob']&nbsp;</div>
<div>&nbsp;</div>
<div>&gt;&gt;&gt; b.split(&#8220;..&#8221;,2)&nbsp;</div>
<div>['my', 'name', 'is..bob']&nbsp;</div>
<div>&nbsp;</div>
<div>&gt;&gt;&gt; b.split(&#8220;..&#8221;,-1)&nbsp;</div>
<div>['my', 'name', 'is', 'bob']&nbsp;</div>
<div>&nbsp;</div>
<div>可以看出 b.split(&#8220;..&#8221;,-1)等价于b.split(&#8220;..&#8221;)&nbsp;</div>
]]></content:encoded>
			<wfw:commentRss>https://thetownes.coolpage.biz/?feed=rss2&#038;p=484</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
