answersLogoWhite

0


Best Answer

In order to find whether a character in a string is in uppercase or not, you need to use the ascii\unicode values of the character.

You may want to use the following code--

String str="Your Sample String Here"; //(say you have this string)

int l=str.length();

for(int i=0;i<l;i++)

{

char ch=str.charAt(i);

if(ch>=65&&ch<=90)

//Since the values of block letters in ASCII are from 65 to 90

System.out.println(ch);

}

//This program basically prints out the block letters, but you can modify it as you like, by changing the statement after 'if' as you want

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you identify the character in a string is uppercase?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What method returns the uppercase equivalent of a string?

The toUpperCase() method returns the uppercase equivalent of a string.


Java program to convert lowercase to uppercase?

You can use the toUpperCase() method on a String to convert any String to all uppercase.


Changing a word to all uppercase letters in c plus plus?

To change any string to uppercase, loop through each character in the string. If the character is in the range 'a' through 'z', decrement the character by decimal 32 (the difference between ASCII value 'a' and 'A'). The following function shows an example of this: void to_upper(std::string&amp; str) { for(int i=0; i&lt;str.size(); ++i) if(str[i]&gt;='a' &amp;&amp; str[i]&lt;='z') str[i]-=32; }


How to Uppercase the all vowels in Java?

Assuming that you want to uppercase only the vowels in a String, you can write a loop to go through all the chracters in a String and when a character is a vowel you can convert it to uppercase. I think one way to do this is as follows:String originalString = "aobxkijejku";StringBuffer buffer = newStringBuffer(originalString);for(int i = 0, len = originalString.length(); i < len; i++){if(buffer.charAt(i) 'u'){buffer.setCharAt(i, 'U');}}String modifiedString = buffer.toString();


What is the Uppercase character of the word captain?

Enter the Uppercase character of the word "capTain"


What is the Uppercase character of the word of capTain?

Enter the Uppercase character of the word "capTain"


What is initcap?

the initcap function sets the first character in each word to uppercase and the rest to lowercase.The syntax for the initcap function is:initcap( string1 )string1 is the string argument whose first character in each word will be converted to uppercase and all remaining characters converted to lowercase.


Why is it a bad idea to name your class string?

If you are talking about Java, that will cause confusion with the built-in "String" class. Sure, Java will distinguish "String" (with an uppercase "S") from "string" (which has no uppercase letters), but it can be confusing for the programmer. In various other programming languages, the situation may be similar.


The is a unique character string used to identify an access point?

it's called the SSID (service set identifier)


How do you uppercase letters in palindrome string?

Use toupper from ctype.h for every letter. Obviously, it doesn't matter if the string is palindrom or not.


How to convert lowercase to uppercase in java?

In Java you can invoke the toUpperCase()method on a string to convert it to a new string with all upper case characters.For example, "abc".toUpperCase() returns "ABC"Likewise, the static Character.toUpperCase(char ch) method takes a single character and returns the upper-case equivalent of that character (e.g. 'a' -> 'A').


Write a program convert a string from uppercase to lower case and vice-versa without using string tolower and string toupper commands in TCL?

[ string toupper $str ] or [ string tolower $str ]