티스토리 뷰
출처 : http://tory45.egloos.com/4897048
MFC 프로그램 처리시 가끔 문자열에 대해 Token 처리해야 하는 경우가 발생합니다. 이때 token을 위한 buf를 만들고 해제하는 과정이 아주 귀찮습니다.. 이때 사용할수 있는 초 간단 Token 처리 API입니다.
CString strOrg;
CString strTok_1;
CString strTok_2;
CString strTok_3;
strOrg.Format("%s", "123$456$789");
AfxExtractSubString( strTok_1, strOrg, 0, '$');
AfxExtractSubString( strTok_2, strOrg, 1, '$');
AfxExtractSubString( strTok_3, strOrg, 2, '$');
strTok_1에는 "123"이
strTok_2에는 "456"이
strTok_3에는 "789"가 대입됩니다..
====================================================================================================================
참조 : http://msdn.microsoft.com/en-us/library/aa991543(VS.80).aspx
This global function can be used to extract a substring from a given source string.
Header: <afxwin.h>
BOOL AFXAPI AfxExtractSubString (
CString& rString,
LPCTSTR lpszFullString,
int iSubString,
TCHAR chSep = '\n'
);
Parameters
- rString
Reference to a CString object that will receive an individual substring.
- lpszFullString
String containing the full text of the string to extract from.
- iSubString
Zero-based index of the substring to extract from lpszFullString.
- chSep
Separator character used to delimit substrings.
This function is useful for extracting multiple substrings from a source string when a known single character separates each substring. This function searches from the beginning of the lpszFullString parameter each time it is called.
This function will return FALSE if either lpszFullString is set to NULL or the function reaches the end oflpszFullString without finding iSubString+1 occurrences of the specified separator character. The rString parameter will not be modified from its original value if lpszFullString was set to NULL; otherwise, the rString parameter is set to the empty string if the substring could not be extracted for the specified index.
- Total
- Today
- Yesterday
- In App Purchase
- 상품 등록
- html tag
- 앱 스토어
- 명령어
- MainActor
- 진수 변환
- 공백제거
- 특정 문자를 기준으로 자르기
- Task
- hyper-v
- .submit()
- trim
- async
- 문자 자르기
- mssql
- FileUpload
- nl2br
- 아이폰
- System.Diagnostics
- await
- system.io
- App Store
- 제품 등록
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |