- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我使用的是 android 4.2 SDK,我在这行代码上收到警告:
String text0 = tagalogText.getText().toString();
String textA = text0.substring(0, 1).toUpperCase() + text0.substring(1).toLowerCase();
当我将鼠标悬停在它上面时,它会显示:
Implicitly using the default locale is a common source of bugs: Use toUpperCase(Locale) instead.
和
隐式使用默认语言环境是错误的常见来源:改用 toLowerCase(Locale)。
我从 Java 复制代码,而不是从 Java for android 复制代码。有谁知道如何消除这个错误?为什么它现在成为使用此方法的首选方式?
最佳答案
只需要清理项目。
我遇到了同样的问题。我没有依赖默认语言环境,并明确尝试了 Locale.US 和 Locale.English,但仍然收到黄色 Lint 警告。打扫完就走了。
string.toLowerCase(Locale.ENGLISH);
关于android - 如何在 android 4.2 中使用 toUppercase(locale)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17288513/
我想知道为什么 Character.toUpperCase/toLowerCase 没有像 String.toUpperCase/toLowerCase 这样的 Locale 参数。 我必须将任何语言
这是我的程序的代码。主要方法已提供,不可触及。 main 方法将 String 转换为大写,但不接受 toUpperCase(); java方法。如何在不改变 main 方法的情况下解决这个问题? p
我们需要从大写字符串中获取字符流。有两种方法: word.toUpperCase().chars() word.chars().map(Character::toUpperCase) 哪种方法更好?
我想知道为什么 Character.toUpperCase/toLowerCase 没有像 String.toUpperCase/toLowerCase 这样的 Locale 参数。 我必须首先将可以
我正在尝试以这种特定的方式解决编码挑战。 目标是将字符串的每个第二个字母大写。 当我使用 letterArray[0] 或任何其他数字运行代码时,代码运行完美。但当我将其切换到 letterArray
我有以下字符串数组 let example = ["hello", "what"]; 我想将此数组转换为: ["Hello", "what"]; 为了实现这一点,我有以下代码: example[0]
当名称全部为大写时,该函数应该向用户喊回。例如,当名称为“JERRY”时,函数应返回字符串“HELLO, JERRY!”控制台记录错误:.toUpperCase() 不是函数。 var hello =
这个问题已经有答案了: toUpperCase() is not making the string upper case (9 个回答) 已关闭 2 年前。 我是 Javascript 新手,对 t
就在前几天,我遇到了一个奇怪的错误。我必须构建一串字符。作为分隔符,我正在与之通信的主机系统使用了 char 254。无论如何,我构建了我的字符串并将其发送到主机。在主机上我收到 char 222 作
这个问题已经有答案了: toUpperCase() is not making the string upper case (9 个回答) 已关闭 2 年前。 我是 Javascript 新手,对 t
这个问题已经有答案了: 已关闭10 年前。 Possible Duplicate: How do I compare strings in Java? Strings in Java : equals
典型输入如下... Department one 在我的函数中... var chksDept = $('input[type=checkbox].actEmail:checked'); var de
我想在每次更改输入字段的内容时执行 toUpperCase()。我的意思不是当字段失去焦点时,而是每次键入字符时。 我尝试了这个,但没有用(我对 JQ 还很陌生)! $(".myClass").cha
if (json.ScheduleCareProviderScheduledPatientsGetResult.Appointments[i].Patient.Firstname.toUpperCas
我不知道我做错了什么;但不知何故 .toUpperCase() 字符串函数在我的浏览器上不起作用还是我弄错了什么? var string ="kjsdgfiIJHBVSFIU"; string.toU
我正在尝试解决一个问题,该问题采用特定符号并将其从字符串中删除,然后将该符号后面的字符转换为大写。但由于某种原因,大写字符后面的字符也变成大写。 s 是给定的字符串。 String[] symbols
我正在尝试编写一个接受字符串的函数,该字符串将以数组内的“waved”版本返回: wave("stack") => ["Stack","sTack", "stAck", "staCk", "stack
这就是我想要的代码。当您写入任何单词时,它会使用 onkeyup 自动更改为大写。此外,当用户单击新窗口时,大写字母将显示在新窗口中。我只能做第一部分。我该怎么做呢? https://jsfiddle
我正在尝试修复由forbiddenapis 报告的错误。我有这样一句话: paramMap.put(Config.TITLEBOOST.toUpperCase(), titleBoost); 所以,它
再说一遍:我在这里学习!很抱歉回答这些基本问题,但我必须学习...... 使用我在网上读到的一个技巧,我试图将其从全部大写改为大写首字母。请参阅此处的代码 - 特别是我们正在查看 JavaScript
我是一名优秀的程序员,十分优秀!