国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

使用CString 的 SpanIncluding 函數判斷字符串是否全為數字

2019-11-08 19:35:01
字體:
來源:轉載
供稿:網友
BOOL IsDigital(LPCTSTR lpszSrc) { CString Src = lpszSrc; return (Src == Src.SpanIncluding( _T("0123456789" ) )); } //測試代碼 VERIFY( IsDigital( _T("23456") ) ); VERIFY( IsDigital( _T("23ABC") ) ); if(str.SpanIncluding(_T("0123456789")) == str){ //is digit}

This method extracts characters from the string, starting with the first character, which are in the set of characters identified by lpszCharSet. If the first character of the string is not in the character set, then SpanIncluding returns an empty string. Otherwise, it returns a sequence of consecutive characters which are in the set.

CString SpanIncluding( LPCTSTR lpszCharSet ) const;

Parameters lpszCharSet Specifies a string interPReted as a set of characters. Return Value Returns a substring that contains characters in the string that are in lpszCharSet, beginning with the first character in the string and ending when a character is found in the string that is not in lpszCharSet. SpanIncluding returns an empty substring if the first character in the string is not in the specified set.


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 晋州市| 曲靖市| 高碑店市| 南乐县| 宁乡县| 高州市| 博湖县| 康马县| 扬中市| 和平区| 新干县| 扶风县| 新巴尔虎左旗| 合川市| 柳林县| 丰原市| 洪泽县| 鄄城县| 庆云县| 泗洪县| 股票| 元朗区| 六盘水市| 麦盖提县| 广州市| 柘荣县| 武义县| 霍城县| 门头沟区| 宿松县| 富民县| 米林县| 东光县| 昭通市| 丰台区| 张家口市| 裕民县| 太和县| 镇远县| 如东县| 小金县|