updated examples

added bound checking to some string members
fixed error with old string code (string<char> is a different type than
string<char16_t> can't access protected members of the other class from
the one)
add "to" member function that wraps text_as and returns a string