]> git.saurik.com Git - apple/system_cmds.git/blob - CPPUtil/UtilString.cpp
80d5cc3c3e69f347952d729e03129e2fda8298f3
[apple/system_cmds.git] / CPPUtil / UtilString.cpp
1 //
2 // UtilString.cpp
3 // CPPUtil
4 //
5 // Created by James McIlree on 4/17/13.
6 // Copyright (c) 2013 Apple. All rights reserved.
7 //
8
9 #include "CPPUtil.h"
10
11 BEGIN_UTIL_NAMESPACE
12
13 bool ends_with(std::string& str, std::string postfix) {
14 size_t pos = str.rfind(postfix);
15 return ((pos != std::string::npos) && (pos == (str.length() - postfix.length())));
16 }
17
18 END_UTIL_NAMESPACE