From f796358af67a4a9f31318458cfa2bca10a9ddd1d Mon Sep 17 00:00:00 2001 From: sam-astro <77079540+sam-astro@users.noreply.github.com> Date: Mon, 3 Jan 2022 12:05:54 -0500 Subject: [PATCH] Removed for loops in place of .substr() --- Slang/Main.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Slang/Main.cpp b/Slang/Main.cpp index f392206..537341e 100644 --- a/Slang/Main.cpp +++ b/Slang/Main.cpp @@ -38,8 +38,7 @@ string StringRaw(string str) if (str[0] != '\"') withoutQuotes += str[0]; - for (int ch = 1; ch < (int)str.size() - 1; ch++) - withoutQuotes += str[ch]; + withoutQuotes += str.substr(1, str.size()-2); if (str[str.size() - 1] != '\"') withoutQuotes += str[str.size() - 1]; @@ -72,8 +71,7 @@ string RMParenthesis(string str) if (str[0] != '(') withoutParenthesis += str[0]; - for (int ch = 1; ch < (int)str.size() - 1; ch++) - withoutParenthesis += str[ch]; + withoutParenthesis += str.substr(1, str.size()-2); if (str[str.size() - 1] != ')') withoutParenthesis += str[str.size() - 1];