Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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;
}
 
PREVIOUS NEXT
Tagged: #check #string #isogram
ADD COMMENT
Topic
Name
3+3 =