First render.
This commit is contained in:
41
src/dawn/util/String.hpp
Normal file
41
src/dawn/util/String.hpp
Normal file
@@ -0,0 +1,41 @@
|
||||
// Copyright (c) 2023 Dominic Masters
|
||||
//
|
||||
// This software is released under the MIT License.
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class String {
|
||||
public:
|
||||
/**
|
||||
* Converts the given string to lowercase.
|
||||
*
|
||||
* @param str String to convert.
|
||||
* @return The lowercase string.
|
||||
*/
|
||||
static std::string toLowercase(const std::string &str);
|
||||
|
||||
/**
|
||||
* Checks if the given string includes the given needle.
|
||||
*
|
||||
* @param str String to check.
|
||||
* @param needle String to check for.
|
||||
* @return True if the string includes the needle.
|
||||
*/
|
||||
static bool_t includes(const std::string &str, const std::string &needle);
|
||||
|
||||
/**
|
||||
* Splits the given string by the given delimiter.
|
||||
*
|
||||
* @param str String to split.
|
||||
* @param delim Delimiter to split by.
|
||||
* @return The split string.
|
||||
*/
|
||||
static std::vector<std::string> split(
|
||||
const std::string &str,
|
||||
const std::string &delim
|
||||
);
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user