Function right


#include <include/EASTL/string.h>

this_type right(size_type n) const


No description yet.


Lines 3117-3126 in include/EASTL/string.h. Line 744 in include/EASTL/string.h.

template <typename T, typename Allocator>
inline basic_string<T, Allocator> basic_string<T, Allocator>::right(size_type n) const
    const size_type nLength = length();
    if(n < nLength)
        return substr(nLength - n, n);
    // C++ std says that substr must return default constructed allocated, but we do not.
    // Instead it is much more practical to provide the copy of the current allocator
    return basic_string(*this, get_allocator());

Add Discussion as Guest

Log in