博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
替换子字符串(将字符串中的某个子字符串替换为给定的字符串)
阅读量:3527 次
发布时间:2019-05-20

本文共 600 字,大约阅读时间需要 2 分钟。

#include 
#include
#include
#include
int replace_sub_str(const char *str,const char *substr,char *repstr,char *result){ const char *p,*q,*re,*temp1; //char *q; char *temp,*t; int n,count = 0,m,i; p = str; q = substr; re = repstr; n = strlen(q); m = strlen(re); temp = (char*)malloc(n+1); memset(temp,0x00,n+1);t = result; while(*p) { memcpy(temp,p,n); if(strcmp(temp,q)==0) { count++; memset(temp,0x00,n+1); p = p + n; temp1 = repstr; for(i = 0;i

转载地址:http://jlkhj.baihongyu.com/

你可能感兴趣的文章
python练习编程网址
查看>>
Python练习小程序1
查看>>
pytorch用于多标签分类的bceloss
查看>>
C++程序设计:打印杨辉三角形
查看>>
C# 方法内改变参数的引用 不影响方法外的值
查看>>
C# vs2019 智能提示中文突然变成英文
查看>>
linux开机引导和启动过程(详细)(含配置文件解读)
查看>>
Vue学习笔记——常见简写&修饰符
查看>>
vue-element-admin源码解读——项目启动过程
查看>>
ubuntu安装teamviewer
查看>>
python多进程multiprocessing应用
查看>>
通过python对虚拟机(kvm)的实时全面监控
查看>>
python pyhook、pyqt4安装
查看>>
python 监控windows弹窗(pywin32)
查看>>
python实现windows窗体截图的三种方式
查看>>
PyQt5用户GUI制作(初识pyqt5)
查看>>
PyQt5布局管理
查看>>
PyQt5菜单和工具栏
查看>>
PyQt5事件和信号
查看>>
PyQt5对话框学习
查看>>