serna37's Library

Logo

C++ アルゴリズムとデータ構造のライブラリ

View the Project on GitHub serna37/library-cpp

:heavy_check_mark: 文字列Util
(library/string/util.hpp)

文字列Util

できること

計算量

だいたい $O(\vert S \vert)$

使い方

そのままなので省略

Verified with

Code

#pragma once
string string_to_lower(string s) {
    std::transform(all(s), s.begin(), ::tolower);
    return s;
}
string string_to_upper(string s) {
    std::transform(all(s), s.begin(), ::toupper);
    return s;
}
bool char_is_lower(char c) { // boolで返す
    return islower(c) != 0;
}
bool char_is_upper(char c) { // boolで返す
    return isupper(c) != 0;
}
#line 2 "library/string/util.hpp"
string string_to_lower(string s) {
    std::transform(all(s), s.begin(), ::tolower);
    return s;
}
string string_to_upper(string s) {
    std::transform(all(s), s.begin(), ::toupper);
    return s;
}
bool char_is_lower(char c) { // boolで返す
    return islower(c) != 0;
}
bool char_is_upper(char c) { // boolで返す
    return isupper(c) != 0;
}
Back to top page