Changeset 195 for trunk


Ignore:
Timestamp:
08/07/13 23:36:07 (12 years ago)
Author:
epyon
Message:
  • string/ends_with added
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/nv/string.hh

    r181 r195  
    120120        }
    121121
     122        inline bool ends_with( const std::string& s, const std::string & ending )
     123        {
     124                if ( s.length() >= ending.length() ) {
     125                        return ( 0 == s.compare (s.length() - ending.length(), ending.length(), ending) );
     126                } else {
     127                        return false;
     128                }
     129        }
     130
    122131        template< typename T >
    123132        struct string_length
Note: See TracChangeset for help on using the changeset viewer.