146. 大小写转换 II

146. Lowercase to Uppercase II

Description
Implement an upper method to convert all characters in a string to uppercase.

You should ignore the characters not in alphabet.

Have you met this question in a real interview?  
Example
Given "abc", return "ABC".

Given "aBc", return "ABC".

Given "abC12", return "ABC12".
public class Solution {
    /**
     * @param str: A string
     * @return: A string
     */
    public String lowercaseToUppercase2(String str) {
        // write your code here
        
        return str.toUpperCase();
    }
}    
描述
将一个字符串中的小写字母转换为大写字母。忽略其他不是字母的字符。

您在真实的面试中是否遇到过这个题?  
样例
给出 "abc", 返回 "ABC".

给出 "aBc", 返回 "ABC".

给出 "abC12", 返回 "ABC12".

猜你喜欢

转载自www.cnblogs.com/browselife/p/10645700.html