about summary refs log tree commit diff
path: root/absl/strings/ascii.h
diff options
context:
space:
mode:
Diffstat (limited to 'absl/strings/ascii.h')
-rw-r--r--absl/strings/ascii.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/absl/strings/ascii.h b/absl/strings/ascii.h
index 4195d0934e39..48a9da22e769 100644
--- a/absl/strings/ascii.h
+++ b/absl/strings/ascii.h
@@ -195,7 +195,7 @@ ABSL_MUST_USE_RESULT inline std::string AsciiStrToUpper(absl::string_view s) {
 ABSL_MUST_USE_RESULT inline absl::string_view StripLeadingAsciiWhitespace(
     absl::string_view str) {
   auto it = std::find_if_not(str.begin(), str.end(), absl::ascii_isspace);
-  return absl::string_view(it, str.end() - it);
+  return str.substr(it - str.begin());
 }
 
 // Strips in place whitespace from the beginning of the given string.
@@ -209,7 +209,7 @@ inline void StripLeadingAsciiWhitespace(std::string* str) {
 ABSL_MUST_USE_RESULT inline absl::string_view StripTrailingAsciiWhitespace(
     absl::string_view str) {
   auto it = std::find_if_not(str.rbegin(), str.rend(), absl::ascii_isspace);
-  return absl::string_view(str.begin(), str.rend() - it);
+  return str.substr(0, str.rend() - it);
 }
 
 // Strips in place whitespace from the end of the given string