Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / ios / web / public / string_util.h
blobb5b23b3897442fb86ad54c6fbdf04520f9437c25
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef IOS_WEB_PUBLIC_STRING_UTIL_H_
6 #define IOS_WEB_PUBLIC_STRING_UTIL_H_
8 #include "base/strings/string16.h"
10 namespace web {
12 // Truncates |contents| to |length|.
13 // Returns a string terminated at the last space to ensure no words are
14 // clipped.
15 // Note: This function uses spaces as word boundaries and may not handle all
16 // languages correctly.
17 base::string16 GetStringByClippingLastWord(const base::string16& contents,
18 size_t length);
20 } // namespace web
22 #endif // IOS_WEB_PUBLIC_STRING_UTIL_H_