Reverse a reversed string

    0

    0

    Giovanny Gongora

    Codiga's C++ Recipes

    In-place method

    #include <iostream>
    #include <string>
    
    std::string s2 = std::string(string.rbegin(), string.rend());
    std::cout << "reverse again, create a new string: " << s2 << std::endl;
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.