From 20f7f4a2e8b0d6f1abf71f2d4bbfde92d3464c8b Mon Sep 17 00:00:00 2001 From: skallweitNV <64953474+skallweitNV@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:36:19 +0200 Subject: make String::trim consistent with String::trimStart/trimEnd (#4285) --- source/core/slang-string.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/core/slang-string.h') diff --git a/source/core/slang-string.h b/source/core/slang-string.h index 7c43ad647..6c0dec420 100644 --- a/source/core/slang-string.h +++ b/source/core/slang-string.h @@ -672,11 +672,11 @@ namespace Slang Index startIndex = 0; const char*const data = getData(); while (startIndex < getLength() && - (data[startIndex] == ' ' || data[startIndex] == '\t')) + (data[startIndex] == ' ' || data[startIndex] == '\t' || data[startIndex] == '\r' || data[startIndex] == '\n')) startIndex++; Index endIndex = getLength(); while (endIndex > startIndex && - (data[endIndex-1] == ' ' || data[endIndex-1] == '\t')) + (data[endIndex-1] == ' ' || data[endIndex-1] == '\t' || data[endIndex-1] == '\r' || data[endIndex-1] == '\n')) endIndex--; return StringSlice(m_buffer, startIndex, endIndex); -- cgit v1.2.3