博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
c语言库函数 字符串_C语言的标准库字符串函数
阅读量:2528 次
发布时间:2019-05-11

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

c语言库函数 字符串

标准库字符串函数 (Standard Library String functions)

Mostly, every C compiler provides a set of useful library functions for handling strings. Here is a list of more commonly used functions with their uses:

通常,每个C编译器都会提供一组有用的库函数来处理字符串。 这是更常用的功能及其用途的列表:

Function Use
strlen To find length of a string
strlwr To convert all characters of a string to lowercase
strupr To convert all characters of a string to uppercase
strcpy To copy one string into another
strncpy To copy first n characters of a string into another
strdup To duplicate a string
strrev To reverse a string
strcat To append one string at the end of another string
strncat To append first n characters of a string at the end of another
strcmp To compare two strings
strncmp To compare first n characters of two strings
strcmpi To compare two strings without regarding the case(“I” denotes the func. Ignores case)
stricmp Similar to strcmpi
strnicmp To compare first n characters of two strings without regarding case
strchr To find first occurrence of a given ‘character’ in a string
strrchr To find last occurrence of a given ‘character’ in a string
strstr To find first occurrence of a given ‘string’ in another string
strset Sets all characters of a string to a given character
strnset Sets first n characters of a string to a given character
功能
len 查找字符串的长度
Strlwr 将字符串的所有字符转换为小写
Struts 将字符串的所有字符转换为大写
strcpy 将一个字符串复制到另一个
结构 将字符串的前n个字符复制到另一个
strdup 复制字符串
施特雷夫 反转字符串
strcat 在另一个字符串的末尾附加一个字符串
Strncat 将字符串的前n个字符附加在另一个字符的末尾
strcmp 比较两个字符串
strncmp 比较两个字符串的前n个字符
strcmpi 比较两个字符串时不考虑大小写(“ I”表示函数,忽略大小写)
tric 类似于strcmpi
Strnicmp 比较两个字符串的前n个字符而不考虑大小写
strchr 查找字符串中给定“字符”的首次出现
strrchr 查找字符串中给定“字符”的最后一次出现
strstr 查找另一个字符串中给定“字符串”的首次出现
strset 将字符串的所有字符设置为给定字符
结构集 将字符串的前n个字符设置为给定字符

翻译自:

c语言库函数 字符串

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

你可能感兴趣的文章
网络流(最大流) CQOI 2015 BZOJ 3931 网络吞吐量
查看>>
2016年1月全国网络媒体技术联盟第七届年会的几个关键词
查看>>
BugBugBugBugBugBugBugBugBugBugBugBugBugBugBug
查看>>
LINUX 编译安装 PHP 环境
查看>>
Vue开源项目库汇总-转
查看>>
作业4(第二部分)
查看>>
我需要一个足够大的桌子
查看>>
[BZOJ4523]路由表
查看>>
js 正则,从url中取参数值
查看>>
《Head First Servlets & JSP》-11-Web应用部署
查看>>
android之volley学习
查看>>
C++中析构函数的作用,
查看>>
Jupyter
查看>>
java中long类型转换为int类型
查看>>
Viewbox在UWP开发中的应用
查看>>
给你的应用“一只”智慧的眼睛 —— Barcode常识普及以及识别信息处理
查看>>
PHP基础知识点汇总(三)
查看>>
排序算法
查看>>
sql server系统数据库,temp库的用途
查看>>
推荐一下干货-------为什么你的app不耐看
查看>>