我需要将全州名称转换为其官方州地址代码。例如,从纽约String出发,我需要生产NY。现在,我可以将所有内容放入一个哈希图中,但是似乎必须有一个实用程序?我在Android环境中。我不想为这个工具导入一个大型库。谢谢
我已经准备好了-您可以使用它:
Map<String, String> states = new HashMap<String, String>();
states.put("Alabama","AL");
states.put("Alaska","AK");
states.put("Alberta","AB");
states.put("American Samoa","AS");
states.put("Arizona","AZ");
states.put("Arkansas","AR");
states.put("Armed Forces (AE)","AE");
states.put("Armed Forces Americas","AA");
states.put("Armed Forces Pacific","AP");
states.put("British Columbia","BC");
states.put("California","CA");
states.put("Colorado","CO");
states.put("Connecticut","CT");
states.put("Delaware","DE");
states.put("District Of Columbia","DC");
states.put("Florida","FL");
states.put("Georgia","GA");
states.put("Guam","GU");
states.put("Hawaii","HI");
states.put("Idaho","ID");
states.put("Illinois","IL");
states.put("Indiana","IN");
states.put("Iowa","IA");
states.put("Kansas","KS");
states.put("Kentucky","KY");
states.put("Louisiana","LA");
states.put("Maine","ME");
states.put("Manitoba","MB");
states.put("Maryland","MD");
states.put("Massachusetts","MA");
states.put("Michigan","MI");
states.put("Minnesota","MN");
states.put("Mississippi","MS");
states.put("Missouri","MO");
states.put("Montana","MT");
states.put("Nebraska","NE");
states.put("Nevada","NV");
states.put("New Brunswick","NB");
states.put("New Hampshire","NH");
states.put("New Jersey","NJ");
states.put("New Mexico","NM");
states.put("New York","NY");
states.put("Newfoundland","NF");
states.put("North Carolina","NC");
states.put("North Dakota","ND");
states.put("Northwest Territories","NT");
states.put("Nova Scotia","NS");
states.put("Nunavut","NU");
states.put("Ohio","OH");
states.put("Oklahoma","OK");
states.put("Ontario","ON");
states.put("Oregon","OR");
states.put("Pennsylvania","PA");
states.put("Prince Edward Island","PE");
states.put("Puerto Rico","PR");
states.put("Quebec","QC");
states.put("Rhode Island","RI");
states.put("Saskatchewan","SK");
states.put("South Carolina","SC");
states.put("South Dakota","SD");
states.put("Tennessee","TN");
states.put("Texas","TX");
states.put("Utah","UT");
states.put("Vermont","VT");
states.put("Virgin Islands","VI");
states.put("Virginia","VA");
states.put("Washington","WA");
states.put("West Virginia","WV");
states.put("Wisconsin","WI");
states.put("Wyoming","WY");
states.put("Yukon Territory","YT");
问题内容: 我正在尝试获取特定时区的当前时间。我尝试了以下代码。 我得到的答案令人惊讶-16:57-错了1个小时tz.getRawOffset()-7000 3600000是-为什么亚利桑那州的夏令时是正确的?如何获得凤凰城或美国任何其他城市的正确挂钟时间? 问题答案: 亚利桑那州处于山区时区,但未遵守DST。如果您将时区指定为“ US / Mountain”,则计算机将应用Mountain时区中
1.自我介绍 2.对于Redis的理解 3.说一下集合,ArrayList的常用方法 4.讲一下hashmap 5.spring的常用注解 6.有没有使用过Linux,用过哪些命令? #我的实习求职记录#
3月2号 继续面啦,笔试过了之后约了面试,大概半个小时多一点。 自我介绍 webpack有配置过哪些 (谁懂啊我还没来得及看webpack,真的不会) webpack的loader有哪些 webpack的loader作用 webpack的plugin有哪些(只说了一个mini-css-extra-plugin,webpack是真没看) js原型链理解 说一下一个数组的原型链 cookie和loca
我试图在我的windows计算机上运行skeleton navigation typescript vs,但失败了–我只看到欢迎屏幕,在开发人员工具中有一条消息: http://localhost:9000/dist/main.js未能加载资源:服务器以404状态响应 我从医生那里一步一步做。http://aurelia.io/docs.html#/aurelia/framework/1.0.0-
我正在使用iText7和pdfHTML(版本2.0.0)来创建PDF。我想在pdf中打印叙利亚文本(RTL语言)。在超文本标记语言文件中使用下面的代码。 添加了pdfcalgram(版本2.0.0)作为该项目的参考。我遵循同样的方法打印阿拉伯字体。这在pdf中从右到左显示。但是叙利亚文本显示为从左到右。请帮我解决这个问题。
我正在用Cassandra开始一个新项目(并计划使用最新的稳定版(1.2.x))。我尝试过几种不同的Java库,如Hector、Astyanax、Cassandra jdbc。。。 其中,(简而言之)我的选择是阿斯蒂亚纳克斯。但后来我也发现并尝试了数据堆栈的Java驱动程序,它支持新的CQL二进制协议,如果你只使用CQL,它要干净得多。而且1.0.0 GA版本似乎很快就会发布。 你会推荐哪一个?谢