由网友(怪我太傻)分享简介:据我所知,在Java中我可以得到平日正常(星期五)或短模式(星期五)。但是,有什么办法只获得第一个字母?As far I know, in Java I can get weekdays in normal (Friday) or short mode (Fri). But, there is any way to...
据我所知,在Java中我可以得到平日正常(星期五)或短模式(星期五)。但是,有什么办法只获得第一个字母?
As far I know, in Java I can get weekdays in normal (Friday) or short mode (Fri). But, there is any way to obtain only first letter?
我想我可以用串拿到第一个字母,但它不会是正确的所有语言。例如,西班牙平日:Lunes酒店,貂,Miércoles,Jueves,Viernes,Sábado和多明戈,以及Miércoles的第一个字母为X,而不是m从貂
I thought I can get first letter using "substring", but it won't be correct for all languages. For example, spanish weekdays are: Lunes, Martes, Miércoles, Jueves, Viernes, Sábado and Domingo, and first letter for "Miércoles" is X instead of M to difference it from "Martes".
推荐答案
在Android中你可以使用的SimpleDateFormat与EEEEE。在下面的例子中,你可以看到它。
In Android you can use SimpleDateFormat with "EEEEE". In the next example you can see it.
SimpleDateFormat formatLetterDay = new SimpleDateFormat("EEEEE",Locale.getDefault());
String letter = formatLetterDay.format(new Date());
相关推荐
最新文章