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
The toUpperCase() method returns the uppercase equivalent of a string.
You can use the toUpperCase() method on a String to convert any String to all uppercase.
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& str) { for(int i=0; i<str.size(); ++i) if(str[i]>='a' && str[i]<='z') str[i]-=32; }
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();
it's called the SSID (service set identifier)
The toUpperCase() method returns the uppercase equivalent of a string.
You can use the toUpperCase() method on a String to convert any String to all uppercase.
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& str) { for(int i=0; i<str.size(); ++i) if(str[i]>='a' && str[i]<='z') str[i]-=32; }
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();
Enter the Uppercase character of the word "capTain"
Enter the Uppercase character of the word "capTain"
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.
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.
it's called the SSID (service set identifier)
Use toupper from ctype.h for every letter. Obviously, it doesn't matter if the string is palindrom or not.
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').
[ string toupper $str ] or [ string tolower $str ]