<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:media="http://search.yahoo.com/mrss/"
	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>字符串 - 四号程序员</title>
	<atom:link href="https://www.coder4.com/archives/tag/%E5%AD%97%E7%AC%A6%E4%B8%B2/feed" rel="self" type="application/rss+xml" />
	<link>https://www.coder4.com</link>
	<description>Keep It Simple and Stupid</description>
	<lastBuildDate>Wed, 01 Mar 2023 07:45:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>Go解析字符串到时间</title>
		<link>https://www.coder4.com/archives/7825</link>
					<comments>https://www.coder4.com/archives/7825#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Wed, 01 Mar 2023 07:44:13 +0000</pubDate>
				<category><![CDATA[Go]]></category>
		<category><![CDATA[go]]></category>
		<category><![CDATA[Parse]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[字符串]]></category>
		<category><![CDATA[解析]]></category>
		<guid isPermaLink="false">https://www.coder4.com/?p=7825</guid>

					<description><![CDATA[time.Parse(layout, "2023-03-04") 其中layout用类似"2006-01-02 15:04:05"这样的字符串做模板，这个对开发者太友好了，再也不用yyyy记忆了，一些内置的如下： const ( ANSIC = "Mon Jan _2 15:04:05 2006" UnixDate = "Mon Jan _2 15:04:05 MST 2006" RubyDate = "Mon Jan 02 15:04:[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/7825/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Shell如何分割字符串</title>
		<link>https://www.coder4.com/archives/7804</link>
					<comments>https://www.coder4.com/archives/7804#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Thu, 12 Jan 2023 05:05:44 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[分割]]></category>
		<category><![CDATA[字符串]]></category>
		<guid isPermaLink="false">https://www.coder4.com/?p=7804</guid>

					<description><![CDATA[str="a,b" arr=(${str//,/ }) echo ${arr[1]} # output b &#160;[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/7804/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Go读取文件到字符串 / 写字符串到文件</title>
		<link>https://www.coder4.com/archives/7184</link>
					<comments>https://www.coder4.com/archives/7184#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Fri, 05 Feb 2021 13:58:31 +0000</pubDate>
				<category><![CDATA[Go]]></category>
		<category><![CDATA[go]]></category>
		<category><![CDATA[写文件]]></category>
		<category><![CDATA[字符串]]></category>
		<category><![CDATA[读文件]]></category>
		<guid isPermaLink="false">https://www.coder4.com/?p=7184</guid>

					<description><![CDATA[读取文件 fileData, err := ioutil.ReadFile(filePath) if err != nil { panic(err) } fileStr := string(fileData) 写文件 f, err := os.OpenFile(filename, os.O_WRONLY&#124;os.O_CREATE, 0600) if err != nil { panic(err) } defer f.Close() io.WriteStrin[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/7184/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>flex &#038; bison 如何用yylval传递字符串值</title>
		<link>https://www.coder4.com/archives/3975</link>
					<comments>https://www.coder4.com/archives/3975#comments</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Sun, 15 Sep 2013 14:51:03 +0000</pubDate>
				<category><![CDATA[计算机技术]]></category>
		<category><![CDATA[bison]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[yylval]]></category>
		<category><![CDATA[字符串]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=3975</guid>

					<description><![CDATA[flex进行scanner，将数值存入yylval。 而bison读取yylval之中的值。 神奇的yylval是int类型，如何让它存储多种类型呢？ 以string为例： 需要在.l和.y的头部第一句加入： #define YYSTYPE char* 在.l赋值的时候，要特别注意，需要拷贝字符串。 yylval = strdup(yytext); return WORD; 在.y取用的时候，直接强转就可以了。 (char*)$1 关于更优雅的实现方式，当然[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/3975/feed</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Linux Shell中将文本小写化</title>
		<link>https://www.coder4.com/archives/3587</link>
					<comments>https://www.coder4.com/archives/3587#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Tue, 24 Jul 2012 07:48:45 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[字符串]]></category>
		<category><![CDATA[小写化]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=3587</guid>

					<description><![CDATA[$ echo &#34;AbcdeFG Hijk,dD&#34;&#124;tr &#039;[:upper:]&#039; &#039;[:lower:]&#039; $ abcdefg hijk,dd[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/3587/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>在一个字符串中找到第一个只出现一次的字符</title>
		<link>https://www.coder4.com/archives/3312</link>
					<comments>https://www.coder4.com/archives/3312#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Sat, 02 Jun 2012 06:41:27 +0000</pubDate>
				<category><![CDATA[算法&数据结构]]></category>
		<category><![CDATA[只出现一次]]></category>
		<category><![CDATA[字符串]]></category>
		<category><![CDATA[第一个]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=3312</guid>

					<description><![CDATA[在一个字符串中找到第一个只出现一次的字符。如输入 abaccdeff，则输出 b。 题目不难，主要是两个条件，注意只出现一次，并且要第一个这种字符。 用stl的map什么的有点不合适，简单数组map即可。 char str_first(char* str) { char* ptr = str; int map[255]; memset(map, 0, sizeof(int)*255); // First O(N), count while(*ptr!=&#03[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/3312/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>数据结构重读 - KMP串匹配算法</title>
		<link>https://www.coder4.com/archives/3150</link>
					<comments>https://www.coder4.com/archives/3150#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Mon, 14 May 2012 08:34:03 +0000</pubDate>
				<category><![CDATA[算法&数据结构]]></category>
		<category><![CDATA[KMP]]></category>
		<category><![CDATA[字符串]]></category>
		<category><![CDATA[数据结构]]></category>
		<category><![CDATA[重读]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=3150</guid>

					<description><![CDATA[设：m是模式串pattern的长度，n是主串长度 传统的字符串匹配(暴力法)的时间复杂度是O(n*m)。 而KMP串匹配算法可以将时间复杂度降为O(n+m)，这需要一个额外的预处理O(m)。 KMP优化的地方在于：当出现字符失配的情况时，无需回溯i指针，而是利用已经匹配的部分，将模式串尽可能向右滑动一部分。 实际上：KMP的预处理本身就是一个模式串pattern“自我匹配”的过程。因此，预处理和kmp算法主体非常神似。 预处理过程： int get_next(ch[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/3150/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>数据结构重读 - 字符串基本操作</title>
		<link>https://www.coder4.com/archives/3147</link>
					<comments>https://www.coder4.com/archives/3147#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Sun, 13 May 2012 13:39:00 +0000</pubDate>
				<category><![CDATA[算法&数据结构]]></category>
		<category><![CDATA[基本操作]]></category>
		<category><![CDATA[字符串]]></category>
		<category><![CDATA[数据结构]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=3147</guid>

					<description><![CDATA[字符串(string)是由零个或者多个字符串组成的有限序列。 字符串中字符的数目称为字符串的长度。 串中任意个连续字符组成的子序列称为改串的子串。包含子串的串相应地称为主串。 串相等：当且仅当两个串的长度相等，并且各个对应位置的字符都相等时。 由一个或者多个空格组成的串'  '称为空格串，非空字符串！ C语言中的字符串最末尾是'\0'，这个不用解释了。 串赋值StrAssign、串比较StrCompare、串求长StrLength、串连接StrConcat以及[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/3147/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Python生成随机字符串(可读字符串)</title>
		<link>https://www.coder4.com/archives/2250</link>
					<comments>https://www.coder4.com/archives/2250#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Fri, 30 Sep 2011 10:49:05 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[字符串]]></category>
		<category><![CDATA[随机]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=2250</guid>

					<description><![CDATA[我们要的是一个可读的字符串，因此os.urandom这种是不靠谱的。 [python] #生成一个Population pop = [chr(i) for i in xrange(33, 126 + 1)] #sample随机选取，然后再Join print &#34;&#34;.join(random.sample(pop, 64)) [/python][......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/2250/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>C++使用strtok实现分割字符串。</title>
		<link>https://www.coder4.com/archives/2188</link>
					<comments>https://www.coder4.com/archives/2188#respond</comments>
		
		<dc:creator><![CDATA[coder4]]></dc:creator>
		<pubDate>Wed, 21 Sep 2011 11:08:14 +0000</pubDate>
				<category><![CDATA[C && C++]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[分割字符串]]></category>
		<category><![CDATA[字符串]]></category>
		<guid isPermaLink="false">http://www.coder4.com/?p=2188</guid>

					<description><![CDATA[C++中有一些号称很优雅的功能和方法……但是有的压根不能指定分隔符，有的依赖于stream所以分隔符只能是char，真是Ugly到家了…… 比如stackoverflow中提到的诸多方法：http://stackoverflow.com/questions/236129/how-to-split-a-string-in-c 其实strtok是标准的c函数啊，而且现在重入问题也已经被解决了，通过保存指针的方式，为什么不喜欢用呢？ 我一直认为，C++是最难用的语言，没有之一。 9[......] 继续阅读]]></description>
		
					<wfw:commentRss>https://www.coder4.com/archives/2188/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
