From 713520caac131a54d4ef7cc5037b51ecc718612e Mon Sep 17 00:00:00 2001 From: HanishKVC Date: Thu, 2 May 2024 06:23:31 +0530 Subject: [PATCH] SimpCfg:CheckStrings: Organise and Probe - p1 std::string --- common/simpcfg.hpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/common/simpcfg.hpp b/common/simpcfg.hpp index cc99e6621..b3fdb7d75 100644 --- a/common/simpcfg.hpp +++ b/common/simpcfg.hpp @@ -308,10 +308,15 @@ public: void check_strings() { - std::string sT11 = "123"; - std::string sT12 = "1अ3"; - std::cout << std::format("string: [{}] len[{}] size[{}]", sT11, sT11.length(), sT11.size()) << std::endl; - std::cout << std::format("string: [{}] len[{}] size[{}]", sT12, sT12.length(), sT12.size()) << std::endl; + std::vector vStandard = { "123", "1अ3" }; + for(auto sCur: vStandard) { + std::cout << std::format("string: [{}] len[{}] size[{}]", sCur, sCur.length(), sCur.size()) << std::endl; + int i = 0; + for(auto c: sCur) { + std::cout << std::format("string:{}:pos:{}:char:{}[{:x}]\n", sCur, i, c, (uint8_t)c); + i += 1; + } + } std::u8string sT21 = u8"123"; std::u8string sT22 = u8"1अ3";