Removing a character from a string



Am I missing something? std::string() doesn't seem to have a member to
remove all occurances of a character from a string.

For example, given:

s = "encyclopedia"

s.remove('e')

yields:

"ncyclopdia"

What is the best way to do this?

Many thanks.


.



Relevant Pages

  • All occurances of a character in a string
    ... Hi - I am trying to figure out the ruby way of printing all occurances ... of a character in a string.. ... The index method on string gives only the first occurance only. ...
    (comp.lang.ruby)
  • Count occurances of specific character in string
    ... Is there an easy way to count the occurances of a specific character in a ... if a table contains a list of account and subaccount codes ... counts the number of periods in the total string, ...
    (microsoft.public.access.queries)
  • split based on n number of occurances of a character
    ... Is there an easy way (without writing our own proc) to split a string ... based on number of occurances of a character? ...
    (perl.beginners)
  • [TOMOYO #15 3/8] Common functions for TOMOYO Linux.
    ... This file contains common functions (e.g. policy I/O, pattern matching). ... Since TOMOYO Linux is a name based access control, ... TOMOYO Linux's string manipulation functions make reviewers feel crazy, ... the Linux kernel accepts all characters but NUL character ...
    (Linux-Kernel)
  • RfD: Escaped Strings version 4
    ... the S" string can only contain printable characters, ... the S" string cannot contain the '"' character, ... as an escape character for the entry of characters that cannot be ... \b BS (backspace, ASCII 8) ...
    (comp.lang.forth)

Loading