blob: a00d023e35e68bd6b50e46eb1d5d00dedf93eb26 [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ios/web/public/string_util.h"
#include "base/strings/string_util.h"
namespace web {
base::string16 GetStringByClippingLastWord(const base::string16& contents,
size_t length) {
if (contents.size() < length)
return contents;
base::string16 clipped_contents = contents.substr(0, length);
size_t last_space_index =
// TODO(droger): Check if we should return the empty string instead.
// See
if (last_space_index != base::string16::npos)
return clipped_contents;
} // namespace web