- 1、本文档共38页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
java方法大全(Java method Daquan).doc
java方法大全(Java method Daquan)
Java common methods Daquan
Character string
1. Get the length of a string
Length ()
2. Determine whether the prefix or suffix of a string is the same as a known string
Prefix startsWith (String s)
Suffix endsWith (String s)
3. Compare two strings
Equals (String s)
4. Convert the string to the corresponding numeric value
Int Integer.parseInt (string)
Long Long.parseLong (string)
Float type Folat.valueOf (string).FloatValue ()
Double type Double.valueOf (string).DoubleValue ()
4. Convert numeric values to strings
ValueOf (numerical)
5, string search
IndexOf (Srting s) retrieval from scratch
IndexOf (String s, int startpoint) retrieves from startpoint
If not retrieved, -1 will be returned
6. Get the substring of a string
Substring (int startpoint) starts from startpoint
Characters in substring (int start, int end) from start to end
7, replace the string character, remove the string before and after the space
Replace (char old, char new) replaces old with new
(trim)
8. String analysis
StringTokenizer (String s) constructs a parser that uses default delimited characters (spaces, newline, carriage returns, Tab, feed characters)
StringTokenizer (String s, String delim) delim is a delimiter defined by itself
NextToken () gets the language symbols in a string one by one
Boolean hasMoreTokens () returns true as long as the string has a language symbol, otherwise false is returned
How many language symbols are there in countTokens?
Text box and text area
1, text box
TextField () constructs a text box, one character long
TextField (int x) constructs a text box, X characters long
TextField (String s) constructs a text box and displays s
SetText (String s) sets the text to s
GetText () gets text
SetEchoChar (char c) sets the display character to C
SetEditable (Boolean) sets whether the text box can be modified
AddActionListener () add monitor
RemoveActionListener () remove monitor
2, text area
TextArea () constructs the text area
TextArea (String s) c
您可能关注的文档
- 我为农民讨公道(I seek justice for the peasants).doc
- 司法会计鉴定-cfe专业资格认证培训(-cfe professional qualification training for forensic accounting accreditation).doc
- 红楼梦研究试题(Research questions of dream of Red Mansions).doc
- 德江县国道绕城公路第二标段施工现场组织设计文字说明.doc
- 全新版大学英语第二版综合教程课文原文及翻译.doc
- 如何打造坚实的基层团队(How to build a solid grassroots team).doc
- 中级导游员《导游知识专题》经典复习资料[].doc
- 【创新设计】2015高考数学(苏教文)一轮配套文档:第5篇 第1讲 平面向量的概念及其线性运算( 2014高考).doc
- 光纤通信原理教师参考书_光纤通信网络及新技术实验.docx
- 税控服务器管理系统操作手册-财会人员V.解析.docx
文档评论(0)