如何用文本文件中的其他字符串替换字符串? [英] how to replace a string by other string in a text file?
本文介绍了如何用文本文件中的其他字符串替换字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你有答案吗? thx。
Do you have any answer to it? thx.
推荐答案
Umesh写道:
Umesh wrote:
你有没有回答它? thx。
Do you have any answer to it? thx.
sed。
-
Ian Collins。
sed.
--
Ian Collins.
5月30日凌晨3:55,Umesh< fraternitydispo ... @ gmail.comwrote:
On May 30, 3:55 am, Umesh <fraternitydispo...@gmail.comwrote:
你有吗?有什么答案吗?谢谢。
Do you have any answer to it? thx.
system(sed ...)
system("sed ...")
#include< stdio.h>
#include< string.h>
int main()
{
char str [] ="这是一个简单的字符串" ;;
char * pch;
pch = strstr(str," simple");
strncpy(pch," sample",5);
puts(str);
返回0;
}
Quentin Godfroy写道:
#include <stdio.h>
#include <string.h>
int main ()
{
char str[] ="This is a simple string";
char * pch;
pch = strstr (str,"simple");
strncpy (pch,"sample",5);
puts (str);
return 0;
}
Quentin Godfroy wrote:
5月30日凌晨3:55,Umesh< fraternitydispo ... @ gmail.comwrote:
On May 30, 3:55 am, Umesh <fraternitydispo...@gmail.comwrote:
你有答案吗?谢谢。
Do you have any answer to it? thx.
system(" sed ...")
system("sed ...")
这篇关于如何用文本文件中的其他字符串替换字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文