当前位置:网站首页>[C language] add separator to string
[C language] add separator to string
2022-06-25 07:11:00 【ChenXiaoMing start】
Action()
{
char str[]="12345";
char result_str[1024];
add_break(str,",",result_str);
lr_error_message("%s\n",result_str);
return 0;
}
void add_break(char * str,char * str_break,char result_str[1024]){
int i = 0;
int str_len=strlen(str);
memset(result_str,0,sizeof(result_str));
sprintf(result_str,"%c",str[0]);
for (i=1;i<str_len;i++) {
sprintf(result_str,"%s%s%c",result_str,str_break,str[i]);
}
}
边栏推荐
- The upper and lower lines of the shell are merged into one line
- Torchserve pit avoidance Guide
- Changing the background color of tab bar - changing the background color of tab bar
- Pratique de gestion hiérarchique basée sur kubesphere
- 我们不一样
- アルマ / alchemy girl
- The Rust Programming Language
- [Shangshui Shuo series] day 5
- 1W words | 40 pictures | hard core es actual combat
- [2022 dark horse programmer] SQL optimization
猜你喜欢
【ROS2】为什么要使用ROS2?《ROS2系统特性介绍》
アルマ / alchemy girl
In depth analysis of Apache bookkeeper series: Part 3 - reading principle
Expression of fatherly love
I have used it for six years!
レレ / 蕾蕾
Esp8266 & sg90 steering gear & Lighting Technology & Arduino
Power representation in go language
Hongmeng learning notes: creating layouts using XML
Event registration Apache pulsar x kubesphere online meetup hot registration
随机推荐
活动报名|Apache Pulsar x KubeSphere 在线 Meetup 火热来袭
New research shows that human ability to make decisions and process information does not decline until the age of 60
【他字字不提爱,却句句都是爱】
Too beautiful promise because too young
Following the last minor upgrade of nodemcu (esp8266)
Expression of fatherly love
Unity get resource path
Streamnational platform version 1.5 is released, integrating istio and supporting openshift deployment
Blue Bridge Cup SCM module code (matrix key) (code + comments)
Ctfhub web - divulgation d'informations - traversée du Répertoire
Query JSON data in MySQL table
【C语言】给字符串增加分隔符
聚类和分类的最基本区别。
Who can teach me how to learn SCM, what to learn first and how to get started?
Power representation in go language
【ROS2】为什么要使用ROS2?《ROS2系统特性介绍》
[he doesn't mention love, but every word is love]
Report on development status and investment strategy recommendations of global and Chinese graphite polystyrene board industry 2022-2028
Americo technology launches professional desktop video editing solution
[Shangshui Shuo series] day 5