Answers for "c++ check if string is isogram"

C++
0

c++ check if string is isogram

bool is_isogram(std::string str)
{
	bool result = true;

	for(int i = 0; i < str.size(); i++)
	{
		char checking_char = putchar(tolower(str.at(i)));

		for(int x = 0; x < str.size(); x++)
		{
			if(x != i)
			{
				if(checking_char == str.at(x)) 
				{
					result = false;
					break;
				}
			}
		}
	}

	return result;
}
Posted by: Guest on February-20-2022

Code answers related to "c++ check if string is isogram"

Browse Popular Code Answers by Language