【IT专家】提取单词的第一个字符以创建首字母缩略词
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
本文由我司收集整编,推荐下载,如有疑问,请与我司联系
提取单词的第一个字符以创建首字母缩略词
提取单词的第一个字符以创建首字母缩略词[英]Extract first character of word to create acronym How do i use split or stringtokenizer to get only the 1st character of each
word to create an acronym? It would also include the ‘‘ symbol. And it isn’t case sensitive 我如何使用split 或stringtokenizer 来获取每个单词的第一个字符来创建首字母缩
略词?它还包括’‘符号。它不区分大小写
exmaple:
Some Kind Of Long String --- SKOLS 某种长串--- SKOLS
another Kind of Long String --- AKOLS 另一种长串--- AKOLS
string string --- s s string string --- s s
The reason for this is because i have a query that populates a table, and since the
column name are 3 or more words each. it stretches the table, even with a scroll bar placed,
100+ columns with long names would make it look really long. So i would like to reduce space by using only acronyms and generating a legend.
原因是因为我有一个填充表的查询,因为列名每个都是3 个或更多的单词。它延伸
了桌子,即使放置了一个滚动条,100 多个长名称的列也会让它看起来很长。因此我想
通过只使用首字母缩略词并生成一个图例来减少空间。
2
First you need to split the String at either ““ or ““.
首先,您需要将字符串拆分为””或“”。
You can use the “split”method for String. docs.oracle/javase/1.4.2/docs/api/java/lang/String.html#split(ng.String)
您可以对String 使用“split”方法。
docs.oracle/javase/1.4.2/docs/api/java/lang/String.html#split(ng.String) The regular expression would be either space or ampersand. Then you would use the