cplusplus.com
C++ : F.A.Q. : Arrays, Strings, etc : Strings
 
cplusplus.com
Information
Documentation
Reference
Articles
Forum
F.A.Q.
Introduction to C++
Arrays, Strings, etc
Arrays, Strings, etc
Arrays
Strings
Sequencing
Strings
Split a string
Parse CSV data
Parse XML data
C-strings and pointers
strtok()
strupper(), strlower()
Case-insensitive compare
Trim a string
Switch on a string


Strings


Here are issues dealing with handling character strings. Handling textual information is a fundamentally important concept in computer programming. Don’t let the section name limit you though! Many of the concepts discussed in Strings can be used for any sequence type.

Contents

S T R I N G S A R R A Y S
Split a string? sizeof() doesn’t work on arrays!
Parse CSV data? Determine the dimension(s) of my array?
Parse XML data? Pass my (N-dimensional) array to a function?
C-strings and pointers? Pass any (N-dimensional) array to a single function?
strtok()!  
toupper() or tolower() a string? S E Q U E N C I N G
Compare strings without case-sensitivity? Sort stuff?
trim() a string? Sort stuff myself?
Use strings in a switch statement? Reverse a string/array/etc?