C语言 字符串大小写转换 自定义函数
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char * strtolower(char * old)
{
char xx[1000];
int ii, length=0;
length=strlen(old);
for(ii=0; ii<length; ii++)
{
xx[ii]=tolower(old[ii]);
}
xx[ii]='\0';
return xx;
}
char * strtoupper(char * old)
{
char xx[1000];
int ii, length=0;
length=strlen(old);
for(ii=0; ii<length; ii++)
{
xx[ii]=toupper(old[ii]);
}
xx[ii]='\0';
return xx;
}
int main(int argc, char *argv[]) {
printf(strtolower("AAAA"));
printf(strtoupper("bbbbb"));
return 0;
}
C语言 字符串大小写转换 自定义函数的更多相关文章
- c语言 字符串大小写转换
https://www.programmingsimplified.com/c/program/c-program-change-case https://docs.microsoft.com/en- ...
- [Swift]字符串大小写转换,同时实现本地化或设置语言环境
在NSString中提供了3种字符串大小写转换方式:1. 转换字符串大小写2. 转换字符串大小写,并实现本地化3. 转换字符串大小写,并设置语言环境. 一. 转换字符串大小写如果只是想单纯的将字符串进 ...
- 【转】Python 字符串大小写转换
转载自:python 中字符串大小写转换 一.pyhton字符串的大小写转换, 常用的有以下几种方法: 1.对字符串中所有字符(仅对字母有效)的大小写转换,有两个方法: print 'just to ...
- 1991: C语言实验——大小写转换
1991: C语言实验——大小写转换 Time Limit: 1 Sec Memory Limit: 64 MBSubmit: 183 Solved: 109[Submit][Status][We ...
- FastReport调用Delphi中的人民币大写转换自定义函数
FastReport调用Delphi中的人民币大写转换自定义函数 FastReport调用Delphi中的人民币大写转换自定义函数 function TJzpzEdit1.MoneyCn(mmje ...
- linux bash shell:最方便的字符串大小写转换(lowercase/uppercase conversion) (转)
原文地址:https://blog.csdn.net/10km/article/details/83384145 关于字符串大小写转换,是写 linux 脚本经常干的事儿,所以总想找个方便的方法让我少 ...
- python 字符串大小写转换(不能使用swapcase()方法)
python 3字符串大小写转换 要求不能使用swapcase()方法 #!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Hiuhung Wa ...
- boost 字符串大小写转换
示例代码如下: #include <boost/algorithm/algorithm.hpp> #include <iostream> using namespace std ...
- java字符串大小写转换的两种方法
转载自:飞扬青春sina blogjava字符串大小写转换的两种方法 import java.io..* public class convertToPrintString { pu ...
随机推荐
- Java多线程-----匿名内部类创建线程
1.继承Thread类创建线程 package com.practise.createthread; public class AnonymousThread { public static v ...
- Swift 了解(2)
循环(Loops) 1. For条件递增语句 ; counter < ; counter++ ) { liftWeights( ) } 语法是这样的:用for作为循环的开始,告诉Xcode你要声 ...
- numpy数学数据处理
数学和统计方法 sum 对数组中全部或某轴向的元素求和.零长度的数组的sum为0. mean 算术平均数.零长度的数组的mean为NaN. import numpy as np import nump ...
- python二叉树的深度遍历之先序遍历流程图
- android使用inject需要注意的地方
android使用inject需要注意的地方1.viewmodel里面添加注解@Inject FavoritesDBManager mFavoritesDBManager; 2.Component里面 ...
- mysql查询语句 查询方式
- make: *** /lib/modules/3.10.0-327.el7.x86_64/build: 没有那个文件或目录。 停止。
1.问题: [root@localhost]# make make -C /lib/modules/-.el7.x86_64/build M=/home/csri/poc/adore modules ...
- linux的错误码error
在程序出错时,我们通过全局变量错误号errno和perror函数能够很快的定位到错误原因. Linux错误代码及其含义 C Name Value Description 含义Success 0 Suc ...
- C++ for循环与迭代器
1.基本的for循环 std::vector<int> arr; ... for(std::vector<int>::iterator it=arr.begin();it!=a ...
- The Little Prince-12/11
The Little Prince-12/11 最后一段话!!!hha,傻傻的我们...... 成人们对数字情有独钟.如果你为他们介绍一个朋友,他们从不会问你“他的嗓子怎么样?他爱玩什么游戏?他会采集 ...