Given a string str consisting of alphabets, the task is to check whether the given string is starting with a Capital Letter or Not.
Input: str = "GeeksforGeeks" Output: Accepted Input: str = "geeksforgeeks" Output: Not Accepted
- Find the ASCII value of the first character of the string
- Check if this value lies in the range of [65, 90] or not
- If yes, print Accepted
- Else print Not Accepted
Below is the implementation of the above approach:
Accepted Not Accepted
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Program to accept Strings starting with a Vowel
- Put spaces between words starting with capital letters
- Regex in Python to put spaces between words starting with capital letters
- String containing first letter of every word in a given string with spaces
- Count of words whose i-th letter is either (i-1)-th, i-th, or (i+1)-th letter of given word
- Move all occurence of letter 'x' from the string s to the end using Recursion
- First uppercase letter in a string (Iterative and Recursive)
- Get the first letter of each word in a string using regex in Java
- Program to accept a Strings which contains all the Vowels
- Number of positions where a letter can be inserted such that a string becomes palindrome
- Get K-th letter of the decoded string formed by repeating substrings
- Check if the string contains consecutive letters and each letter occurs exactly once
- Program to build a DFA to accept strings that start and end with same character
- Program to build a DFA that accepts strings starting and ending with different character
- Find the starting indices of the substrings in string (S) which is made by concatenating all words from a list(L)
- Find letter's position in Alphabet using Bit operation
- Minimum letters to be removed to make all occurrences of a given letter continuous
- NFA to accept strings that has atleast one character occurring in a multiple of 3
- Build a DFA to accept Binary strings that starts or ends with "01"
- Program to Encrypt a String using ! and @
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : AnkitRai01