`
oszerone
  • 浏览: 12015 次
  • 性别: Icon_minigender_1
  • 来自: 长沙
社区版块
存档分类
最新评论

第7天 Numbers and Strings

    博客分类:
  • Java
 
阅读更多

Number

Byte Short Integer Long Float Double

 

Number

byteValue, shortValue...

compareTo

Integer

MAX_VALUE, MIN_VALUE, SIZE

decode(String nm) 0x 0X # 0

parseInt(String s, int radix)

toXXXString()

toString(int i)

valueOf(String s, int radix) == new Integer(Integer.parseInt(s, radix))

 

数字格式化:

 

d 十进制

f 浮点数

n 换行字符

tB 英文全名月份

td, te 数字天数,te补0

ty, tY 年,2位和4位

tl 12制小时

tM 补0分钟数

tp am/pm小写

tm 补0月份

tD 月/天/年

%+-,08.3d 带符号的左对齐的三位小数带, 分割符的0前缀8位数字

 

DecimalFormat

new DecimalFormat("###,###.###").format(123456.789)

new DecimalFormat("000000.000").format(123456.789)

 

Math

random

 

Character

数字,字母,空白,大写,小写,转换大小写

\t, \b, \n, \r, \f, \", \', \\

 

String

charAt, substring, split, subSequence

trim, toLowerCase, toUpperCase

indexOf, lastIndexOf, contains

拼接, 比较, endsWith, startsWith, compareTo(IgnoreCase), equals, regionMatches, matches

 

StringBuffer, StringBuilder

字符串的构造类,线程安全StringBuilder

 

基本类型和基本类型对象的自动装箱和拆箱

 

什么?数字和字符串的转换、处理、格式化。

 

Numbers and Strings

 

 

分享到:
评论

相关推荐

    Programming in Objective-C, 第四版,ePub格式

    15 Numbers, Strings, and Collections 16 Working with Files 17 Memory Management and Automatic Reference Counting (ARC) 18 Copying Objects 19 Archiving Part III: Cocoa, Cocoa Touch, and the iOS SDK 20...

    Programming in Objective-C Fourth Edition (2011)

    15 Numbers, Strings, and Collections  16 Working with Files  17 Memory Management and Automatic Reference Counting  18 Copying Objects  19 Archiving  Part III Cocoa, Cocoa Touch, and the ...

    Programming in Objective-C(最新第四版)

    15 Numbers, Strings, and Collections 16 Working with Files 17 Memory Management and Automatic Reference Counting 18 Copying Objects 19 Archiving 20 Introduction to Cocoa and Cocoa Touch 21 Writing iOS...

    lua 程序设计学习.doc 版

    第7章 迭代器与泛型for 7.1 迭代器与闭包 7.2 范性for的语义 7.3 无状态的迭代器 7.4 多状态的迭代器 7.5 真正的迭代器 第8章 编译•运行•错误信息 8.1 require函数 8.2 C Packages 8.3 错误 8.4 异常和错误处理 ...

    Program in LUA 2nd Edition.rar

    7 Iterators and the Generic for 55 7.1 Iterators and Closures 55 7.2 The Semantics of the Generic for 57 7.3 Stateless Iterators 58 7.4 Iterators with Complex State 60 7.5 True Iterators 61 8 ...

    java.核心技术.第八版 卷1

    java 核心技术 第八版 core 卷1 Core Java, 8th Edition Core Java. Volume I. Fundamentals, 8th Edition Core Java. Volume II. Advanced Features, 8th Edition 官方网站 http://horstmann.com/corejava.html ...

    C++标准库(第二版)英文版.pdf

    2 Introduction to C++ and the StandardLibrary 7 2.1 Historyof the C++ Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1.1 Common Questionsabout the C++11 Standard . . . . . . . ....

    Python Cookbook英文版

    3.17 Converting Between Unicode and Plain Strings 3.18 Printing Unicode Characters to Standard Output 3.19 Dispatching Based on Pattern Matches 3.20 Evaluating Code Inside Strings 3.21 ...

    javascript权威指南(第六版)

    7. Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 7.1 Creating Arrays 141 7.2 Reading and Writing Array ...

    CLR via C# 第4版 英文PDF

    CHAPTER 14 Chars, Strings, and Working with Text 317 CHAPTER 15 Enumerated Types and Bit Flags 361 CHAPTER 16 Arrays 373 CHAPTER 17 Delegates 391 CHAPTER 18 Custom Attributes 421 CHAPTER 19 Nullable ...

    Advanced Bash-Scripting Guide <>

    备份最后一天所有修改的文件. 4-1. 变量赋值和替换 4-2. 一般的变量赋值 4-3. 变量赋值,一般的和比较特殊的 4-4. 整型还是string? 4-5. 位置参数 4-6. wh,whois 节点名字查询 4-7. 使用shift 5-1. echo 一些诡异的...

    Linux高级bash编程

    备份最后一天所有修改的文件. 4-1. 变量赋值和替换 4-2. 一般的变量赋值 4-3. 变量赋值,一般的和比较特殊的 4-4. 整型还是string? 4-5. 位置参数 4-6. wh,whois节点名字查询 4-7. 使用shift 5-1. echo一些诡异的...

    Lua中文教程(pdf版)

    第7章迭代器与泛型for....40 7.1 迭代器与闭包...........40 7.2 范性for的语义...........42 7.3 无状态的迭代器.......43 7.4 多状态的迭代器.......44 7.5 真正的迭代器...........45 第8章编译·运行·...

    2009 达内Unix学习笔记

    第5~7个是属组,系统管理员分配的同组的一个或几个人,用g表示 第8~10个是其他人,除属组外的人,用o表示 所有人,包括属主、属组及其他人,用a表示 chmod 更改权限; 用法 chmod [-fR] &lt;绝对模式&gt; 文件 ... ...

    编译原理龙书答案

    第二章 2.2 Exercises for Section 2.2 2.2.1 Consider the context-free grammar: S -&gt; S S + | S S * | a Show how the string aa+a* can be generated by this grammar. Construct a parse tree for this string....

Global site tag (gtag.js) - Google Analytics