40 std::string str1=
"filename7.txt";
41 std::string str2=
"filename20.txt";
43 std::cout<<
"str1: "<<str1<<std::endl;
44 std::cout<<
"str2: "<<str2<<std::endl;
48 std::cout<<
"strcmp(str1,str2): "<<strcmp(str1.c_str(),str2.c_str())<<std::endl;
49 std::cout<<
"strcmp(str2,str1): "<<strcmp(str2.c_str(),str1.c_str())<<std::endl;
56 std::cout<<
"Pds::Ra::CiCompare(\"ABC\", \"abc\"): "<<
Pds::Ra::CiCompare(
"ABC",
"abc")<<std::endl;
57 std::cout<<
"Pds::Ra::CiCompare(\"AbC\", \"aBc\"): "<<
Pds::Ra::CiCompare(
"AbC",
"aBc")<<std::endl;
58 std::cout<<
"Pds::Ra::CiCompare(\"abc\", \"abc\"): "<<
Pds::Ra::CiCompare(
"abc",
"abc")<<std::endl;
59 std::cout<<
"Pds::Ra::CiCompare(\"abc\", \"azc\"): "<<
Pds::Ra::CiCompare(
"abc",
"azc")<<std::endl;
60 std::cout<<
"Pds::Ra::CiCompare(\"abc\",\"abc1\"): "<<
Pds::Ra::CiCompare(
"abc",
"abc1")<<std::endl;
int CiCompare(const std::string &str1, const std::string &str2)
Case-insensitive compare. Retorna 0 si las cadenas son iguales o un numero diferente de 0 si no.
bool NaturalCompare(const std::string &str1, const std::string &str2)
Esta función compara las cadenas str1 y str2 de forma natural (tomando en cuenta números).