summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorskallweitNV <64953474+skallweitNV@users.noreply.github.com>2024-06-06 15:36:19 +0200
committerGitHub <noreply@github.com>2024-06-06 15:36:19 +0200
commit20f7f4a2e8b0d6f1abf71f2d4bbfde92d3464c8b (patch)
tree704dbf19bae4ccc1ca19774e769382b9af34a68f /source
parentc0c426c8826aab8fe3c0756ccb1efcf7d47856ae (diff)
make String::trim consistent with String::trimStart/trimEnd (#4285)
Diffstat (limited to 'source')
-rw-r--r--source/core/slang-string.h4
1 files changed, 2 insertions, 2 deletions
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);