answersLogoWhite

0


Best Answer

std::string test ("The cat sat on the mat");

std::string vowels ("aeiouAEIOU");

size_t pos = test.find_first_of (vowels);

if (pos != test.npos)

std::cout << "Vowel found at position " << pos << std::endl;

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Find vowel from given string in C plus plus language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you find a vowel in given string?

#include&lt;stdio.h&gt; #include&lt;stdlib.h&gt; void main() { char string[]="anystring"; int i=0,j,count=0; j=strlen(string); while(i!=j) { if(string[i]=='a'string[i]=='e'string[i]=='o'string[i]=='u'string[i]='i') count++; i++; } }


How do you write a program to find the no of words in a given string in dot net?

You find a language that can be targeted towards the .NET Framework. What you are suggesting is something related to string manipulation and you can work with delimiters.


Find out the square root for that given number using string?

Halv that given number,Make a square that has that half number as the length of a side.Stretch the string across the diagonal of the square from corner to corner.The length of the string is the square root of the given number


Code of find vowels in string in php?

Here is an example of how you can find the vowels in a string using PHP: $str = &quot;Hello World&quot;; $vowels = preg_match_all('/[aeiou]/i', $str, $matches); echo &quot;Vowels found: &quot; . $vowels; This code snippet uses a regular expression to match all vowels (both uppercase and lowercase) in the string &quot;Hello World&quot; and counts how many vowels are found.


How to write A Java program to print number of digits in a given number?

One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.


Do I need to write a program to find a substring in a given string in c plus plus?

No.


How do you write c programme to find proper subset of a given string?

you can use strstr()


How do you find the no of characters and numerics in the given string?

First of all numbers are not meant to be stored in a string and if u do so in C, these numbers will be treated as characters and you can not perform any calculation on these numbers, and to find the number of characters in a string use the strlen() from the string.h file.


Wap in c plus plus to find out the string is palindrome or not in?

use the strrev() function on the given string and compare with original string.If both are equal they are palindromes else not.


How did Theseus find his way out of the labyrinth after killing the Minotaur?

Theseus used a ball of thread/string to find his way out. This was given to him by the princess Ariadne.


What did Theseus use to find his way out of the Labyrinth?

ANSWERTheseus was given a ball of thread by Princess Ariadne who told him to unravel it as he penetrated into the Labyrinth, so he knew the way out after he killed the Minotaur.


What is th function of the charindex?

The CHARINDEX function in SQL is used to find the position of a specific character or substring within a string. It returns the starting position of the substring or character within the given string.