BinaryTree  HW 06
Spell Checking Using Binary Trees
 All Classes Files Functions Variables Pages
Functions
stringutils.hpp File Reference

Miscellaneous utility code for strings. More...

#include <iosfwd>
#include <string>

Go to the source code of this file.

Functions

std::string getWord (std::istream &in)
 Reads a word from input stream in, where a word is the longest possible sequence of alphabetical characters. Reads (and ignores) one non-alphabetic character at the end of the word. More...
 

Detailed Description

Miscellaneous utility code for strings.

Author
CS 70 Provided Code.

Function Documentation

std::string getWord ( std::istream &  in)

Reads a word from input stream in, where a word is the longest possible sequence of alphabetical characters. Reads (and ignores) one non-alphabetic character at the end of the word.

Returns
The word at the start of the input. (This will be the empty string if the input does not start with an alphabetic character.)
Remarks
Only handles words with alphabetic characters; does not skip leading whitespace; returning the empty string is a hacky way of reporting that no word was found.