Mega Code Archive
Search
.Net
ASP .Net
ASP .Net Tutorial
C#
C# Book
C# by API
C# Tutorial
VB.Net
VB.Net by API
VB.Net Tutorial
Visual C++ .Net
VisualBasic Script
Java
Java
Java Book
Java by API
Java Tutorial
Script
Flash ActionScript
Flex
JavaScript DHTML
JavaScript Reference
JavaScript Tutorial
Database
MSSQL
MSSQL Tutorial
MySQL
MySQL Tutorial
Oracle PLSQL
Oracle PLSQL Tutorial
PostgreSQL
Languages
Android
C
C Tutorial
C++
C++ Tutorial
Delphi
Perl
PHP
Python
Python Tutorial
Ruby
Silverlight
Office
MSOfficeExcel 2007 Tutorial
MSOfficePowerPoint 2007 Tutorial
MSOfficeWord 2007 Tutorial
Data
XML
XML Tutorial
C++ Tutorial
String 119 codes
Home
C++ Tutorial
String
1 Accessing characters in a string
2 Accessing characters in string objects
3 Append subscript locations 4 through the end of one string to create another string
4 Append two strings
5 Assign one string to another
6 Case-Sensitive String Comparisons
7 Case-Sensitive Substring Comparison
8 Changing parts of string objects
9 Compare string ignoring the case
10 Compare strings by index
11 Compare sub string
12 Concatenate two strings
13 Convert string to C-Style string
14 Copy char array from a string to a char pointer
15 Copy constructor
16 Create a string from a vectorchar
17 Create a string object using another string object
18 Define a string variable, assign a value and display it
19 Delete characters from the string given position and count
20 Demonstrating member function at
21 Display the capacity of a string
22 Display the maximum string length
23 Display the size of a string
24 Find first occurrence of a character - equivalent of strchr()
25 Find first occurrence of a substring - equivalent of strstr()
26 Find first out of
27 Find last occurrence of a character - equivalent of strrchr()
28 Find last occurrence of a substring - no C-string equivalent
29 Find the first occurance
30 Find the first of any of these chars
31 Find the first of any of these chars starting from the end
32 Find the first thats not in this set
33 Find the first thats not in this set, starting from the end
34 Finding substrings in string objects
35 Functions related to size and capacity
36 If character found, erase to deletes a character
37 If string empty
38 Implement search-and-replace for string objects
39 Input from an istringstream object
40 Insert character to the end of a string
41 Insert one string at location 10 of another string
42 Is it a string
43 Locating all instances of a character
44 Locating all instances of a substring
45 Loop through the string array
46 Modify char in a string by indexer
47 Overloaded string concatenation operator
48 Overloaded string concatenation operator with C-style string
49 Plus string together
50 Print characters read from keyboard in reverse order
51 Read a string from keyboard and decide if to exit a while loop
52 Read string from keyboard and get substring
53 Read string till a sign
54 Remove a word with find() and erase
55 Replace all spaces with period
56 Replace one word with another word
57 Replacing Characters in Strings
58 Reverse the order of all characters inside the string
59 Search a null-terminated string
60 Search a sub string
61 Search for a specific character
62 Search for any of a set of characters In this case, find the first @ or period
63 Search from the beginning
64 Search from the end
65 Searching for the first occurrence of a letter in a string
66 Searching for the first occurrence of a substring in a string
67 Searching for the first occurrence of any character other than o, n, e, or space
68 Searching for the last occurrence of a letter in a string
69 Searching for the last occurrence of a substring in a string
70 Searching for the last occurrence of any character other than o, n, e, or space
71 Set the capacity of a string to 128
72 Set with functor for string comparison
73 Sort all characters inside the string
74 Split file name in command line into base name and extension
75 String
76 String array
77 String arrays
78 String assignment
79 String basics
80 String erase(6,9)
81 String find(substring)
82 String find_first_not_of( substring )
83 String find_first_of( substring )
84 String find_last_of(substring)
85 String insert( 3, string4, 0, string
86 String insert()
87 String member function empty
88 String member function substr
89 String overloaded +=
90 String overloaded equality and relational operators
91 String replace( position, 2, 12345;;123, 5, 2 )
92 String replace()
93 String resize()
94 String rfind(substring)
95 String search with custom comparison function
96 String size grows
97 String size()
98 String size(), string length, string capacity(), string max_size()
99 Substr to-end-of-string option
100 Switch statement based on char value
101 Three forms of erase() function from a string
102 Use == and to compare strings
103 Use char pointer to point to the char array returned from string data()
104 Use cin in while loop to read string
105 Use cin to read string
106 Use erase to remove all characters from (and including) location 6 through the end of string1
107 Use iterator
108 Use member function at() to
109 Use push_back() to add characters to a string
110 Use std
111 Use string compare to compare two strings
112 Use string length() to check the strings size
113 Use strtok() to extract keys and values stored in keyvalue pairs within a string
114 Use strtok() to tokenize a sentence
115 Using a dynamically allocated ostringstream object
116 Using an iterator to output a string
117 Using find with reverse iteration
118 Using string swap function to swap two strings
119 Using the swap function to swap two strings