国产探花免费观看_亚洲丰满少妇自慰呻吟_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.


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 彭水| 武乡县| 治多县| 德令哈市| 和平县| 上饶县| 天津市| 山阳县| 莲花县| 西充县| 镇康县| 文山县| 宜宾县| 江口县| 新田县| 大冶市| 广饶县| 霍山县| 台东市| 鹿邑县| 武邑县| 凉山| 大同县| 施甸县| 晋江市| 双桥区| 武强县| 临夏市| 明光市| 孝昌县| 博爱县| 襄城县| 乌兰浩特市| 丰台区| 夹江县| 新蔡县| 稻城县| 棋牌| 河津市| 会昌县| 江都市|