下面哪一个函数把字符串X中的所有英文单词转换为首字母大写的形式()。
A.initcap()函数
B.concat()函数
C.opper()函数
D.lower()函数
A.initcap()函数
B.concat()函数
C.opper()函数
D.lower()函数
下面函数的功能是将字符变量的值插入已经按ASCII码值从小到大排好序的字符串中。
void fun(char *w,char x,int *n)
{ int i,p=0;
while(x>w[p]) ①;
for(i=*n;i>=p;i--) ②;
w[p]=x;
++*n;
}
请找出下面代码中的所有错误
说明:以下代码是把一个字符串倒序,如“abcd”倒序后变为“dcba”
1、#include"string.h"
2、main()
3、{
4、 char*src="hello,world";
5、 char* dest=NULL;
6、 int len=strlen(src);
7、 dest=(char*)malloc(len);
8、 char* d=dest;
9、 char* s=src[len];
10、 while(len--!=0)
11、 d++=s--;
12、 printf("%s",dest);
13、 return 0;
14、}
,其中s为字符串格式print('%s belongs to %s province' % (city, province))以下哪一个语句的输出与其他几个不同?()
A.location('Jiangsu', 'Nanjing')
B.location('Nanjing', 'Jiangsu')
C.location(city = 'Nanjing', province = 'Jiangsu')
D.location(province = 'Jiangsu', city = 'Nanjing')
面试题:替换空格
题目:请实现一个函数,把字符串中的每个空格替换成"%20"。例如输入“We aer happy.”。
A.includes函数用于判断字符串中是否含有指定的子字符串
B.repeat函数将目标字符串重复N次,目标字符串被修改
C.startsWidth函数判断指定的子字符串是否出现在目标字符串头部位置
D.endsWidth函数判断指定的子字符串是否出现在目标字符串尾部位置