티스토리 뷰
CString Class
주의 사항.
문자열을 다루기 위해 제공되는 클래스.
주의 사항.
CString 객체를 직접 사용할 때는 객체에 대해(LPCTSTR) 연산자를 명시적으로 적용하는 것이 좋다.
CString str = "안녕하세요.";
cout << str << endl;
출력 결과 : 004308F4(포인터로 인식!)
CString str = "안녕하세요.";
cout << (LPCTSTR)str << endl;
출력 결과 : 안녕하세요.
CString str = "안녕하세요.";
cout << str << endl;
출력 결과 : 004308F4(포인터로 인식!)
CString str = "안녕하세요.";
cout << (LPCTSTR)str << endl;
출력 결과 : 안녕하세요.
CString Class Members
Construction
The String as an Array
Assignment/Concatenation
Comparison
Extraction
Other Conversions
Searching
Archive/Dump
Buffer Access
Windows-Specific
CString | Constructs CString objects in various ways. |
GetLength | Returns the number of characters in a CString object. For multibyte characters, counts each 8-bit character; that is, a lead and trail byte in one multibyte character are counted as two characters. |
IsEmpty | Tests whether a CString object contains no characters. |
Empty | Forces a string to have 0 length. |
GetAt | Returns the character at a given position. |
operator [] | Returns the character at a given position — operator substitution for GetAt. |
SetAt | Sets a character at a given position. |
operator LPCTSTR | Directly accesses characters stored in a CString object as a C-style string. |
operator = | Assigns a new value to a CString object. |
operator + | Concatenates two strings and returns a new string. |
operator += | Concatenates a new string to the end of an existing string. |
operator == <, etc. | Comparison operators (case sensitive). |
Compare | Compares two strings (case sensitive). |
CompareNoCase | Compares two strings (case insensitive). |
Collate | Compares two strings (case sensitive, uses locale-specific information). |
CollateNoCase | Compares two strings (case insensitive, uses locale-specific information). |
Mid | Extracts the middle part of a string (like the Basic MID$ function). |
Left | Extracts the left part of a string (like the Basic LEFT$ function). |
Right | Extracts the right part of a string (like the Basic RIGHT$ function). |
SpanIncluding | Extracts a substring that contains only the characters in a set. |
SpanExcluding | Extracts a substring that contains only the characters not in a set. |
MakeUpper | Converts all the characters in this string to uppercase characters. |
MakeLower | Converts all the characters in this string to lowercase characters. |
MakeReverse | Reverses the characters in this string. |
Replace | Replaces indicated characters with other characters. |
Remove | Removes indicated characters from a string. |
Insert | Inserts a single character or a substring at the given index within the string. |
Delete | Deletes a character or characters from a string. |
Format | Format the string as sprintf does. |
FormatV | Formats the string as vsprintf does. |
TrimLeft | Trim leading whitespace characters from the string. |
TrimRight | Trim trailing whitespace characters from the string. |
FormatMessage | Formats a message string. |
Find | Finds a character or substring inside a larger string. |
ReverseFind | Finds a character inside a larger string; starts from the end. |
FindOneOf | Finds the first matching character from a set. |
operator << | Inserts a CString object to an archive or dump context. |
operator >> | Extracts a CString object from an archive. |
GetBuffer | Returns a pointer to the characters in the CString. |
GetBufferSetLength | Returns a pointer to the characters in the CString, truncating to the specified length. |
ReleaseBuffer | Releases control of the buffer returned by GetBuffer. |
FreeExtra | Removes any overhead of this string object by freeing any extra memory previously allocated to the string. |
LockBuffer | Disables reference counting and protects the string in the buffer. |
UnlockBuffer | Enables reference counting and releases the string in the buffer. |
AllocSysString | Allocates a BSTR from CString data. |
SetSysString | Sets an existing BSTR object with data from a CString object. |
LoadString | Loads an existing CString object from a Windows resource. |
AnsiToOem | Makes an in-place conversion from the ANSI character set to the OEM character set. |
OemToAnsi | Makes an in-place conversion from the OEM character set to the ANSI character set. |
728x90
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 람다식(lambda expression)
- jsp 오픈 소스
- system.io
- 진수 변환
- .submit()
- java 키워드 정리
- 메이븐(maven)
- docker
- await
- jstl(java standard tag library)-core
- jstl(java standard tag library)
- 제품 등록
- 표현 언어(expression language)
- 문자 자르기
- java web-mvc
- React
- 스프링 시큐리티(spring security)-http basic 인증
- REST API
- error-java
- 스프링 프레임워크(spring framewordk)
- 스프링 프레임워크(spring framework)
- In App Purchase
- 특정 문자를 기준으로 자르기
- 인텔리제이(intellij)
- MainActor
- java-개발 환경 설정하기
- java.sql
- System.Diagnostics
- 스프링 시큐리티(spring security)
- nl2br
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함