summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/stringutils.cpp8
-rw-r--r--src/utils/stringutils.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp
index 361bc860c..176c5499c 100644
--- a/src/utils/stringutils.cpp
+++ b/src/utils/stringutils.cpp
@@ -578,3 +578,11 @@ bool findCutFirst(std::string &str1, std::string str2)
}
return false;
}
+
+std::string &removeProtocol(std::string &url)
+{
+ int i = url.find("://");
+ if (i != (int)std::string::npos)
+ url = url.substr(i + 3);
+ return url;
+}
diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h
index c0457bc52..25fe11e2d 100644
--- a/src/utils/stringutils.h
+++ b/src/utils/stringutils.h
@@ -201,4 +201,6 @@ bool findCutLast(std::string &str1, std::string str2);
bool findCutFirst(std::string &str1, std::string str2);
+std::string &removeProtocol(std::string &url);
+
#endif // UTILS_STRINGUTILS_H