adding the string function example

This commit is contained in:
Jidong Xiao
2024-01-07 23:30:33 -05:00
parent 372b26c511
commit a19aa83b0a
2 changed files with 40 additions and 0 deletions

View File

@@ -287,6 +287,13 @@ object. There are several ways of constructing string objects:
This [example program](getline.cpp) is the starting point to most of your homeworks. It shows how you can read information from a file, and write information into another file.
## 1.16 Two Useful String Functions
- find()
- substr()
This [example program](strings.cpp) which uses these two string functions, can also be very useful in your homeworks.
<!--## 1.16 C++ vs. Java
- Standard C++ library std::string objects behave like a combination of Java String and StringBuffer objects. If you arent sure of how a std::string member function (or operator) will behave, check its semantics or try it on small examples (or both, which is preferable).