strutils.h

来自「C++&datastructure书籍源码,以前外教提供现在与大家共享」· C头文件 代码 · 共 36 行

H
36
字号
#ifndef _STRUTILS_H#define _STRUTILS_H#include <iostream>#include <string>using namespace std;void ToLower(string & s);// postcondition: all alphabetic characters in s changed to lowercase//                (only uppercase letters changed)void ToUpper(string & s);// postcondition: all alphabetic characters in s changed to uppercase//                (only uppercase letters changed)void StripPunc(string & s);// postcondition: s has no leading/trailing punctuationvoid StripWhite(string & s);// postcondition: s has no leading/trailing white spacestring LowerString(const string & s);// postcondition: return lowercase equivalent of sstring UpperString(const string & s);// postcondition: return uppercase equivalent of sint atoi(const string & s);         // returns int equivalentdouble atof(const string & s);      // returns double equivalentstring itoa(int n);                 // returns string equivalentstring tostring(int n);             // like itoa, convert int to stringstring tostring(double d);          // convert double to string    #endif 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?