Java格式轉(zhuǎn)換
java.text.Format
Format是一個(gè)用于格式化語言環(huán)境敏感的信息(如日期绵载、消息和數(shù)字)的抽象基類,直接已知子類有DateFormat, MessageFormat, NumberFormat衬吆。
Format定義了編程接口,用于將語言環(huán)境敏感的對象格式化為String(使用format方法)和將String重新解析為對象(使用 parseObject方法)。?
通常吠谢,一個(gè)Format的parseObject方法必須能解析任何由其Format方法格式化的字符串份氧。不過唯袄,也可能存在不能解析的異常情況。例如蜗帜,F(xiàn)ormat方法可能創(chuàng)建中間無分隔符的兩個(gè)相鄰整數(shù)恋拷,在這種情況下,parseObject無法判斷哪個(gè)數(shù)字屬于哪個(gè)數(shù)厅缺。
Java平臺為格式化日期蔬顾、消息和數(shù)字分別提供了三個(gè)特殊的Format的子類:DateFormat、MessageFormat和NumberFormat湘捎。具體的子類必須實(shí)現(xiàn)三個(gè)方法:?
format(Object obj, StringBuffer toAppendTo, FieldPosition pos)?
formatToCharacterIterator(Object obj)?
parseObject(String source, ParsePosition pos)?
這些常規(guī)方法允許對對象進(jìn)行多態(tài)解析和格式化诀豁,還可以被使用(如被 MessageFormat 使用)。子類通常也為特定的輸入類型提供了另外的format方法窥妇,也為特定的結(jié)果類型提供了parse方法且叁。當(dāng)在輸入文本的開始沒有任何所需格式的文本時(shí),則任何不帶 ParsePosition參數(shù)的parse方法都應(yīng)該拋出ParseException秩伞。?
大多數(shù)子類還將實(shí)現(xiàn)以下工廠方法:?
getInstance 獲取一個(gè)適合于當(dāng)前語言環(huán)境的有用的格式對象?
getInstance(Locale) 獲取一個(gè)適合于指定語言環(huán)境的有用的格式對象逞带。?
此外欺矫,某些子類還可能為了更特殊的控制實(shí)現(xiàn)其它getXxxxInstance方法。例如展氓,NumberFormat類提供了getPercentInstance和 getCurrencyInstance方法來獲取特殊的數(shù)字格式器穆趴。
Format的子類如果允許程序員能為不同語言環(huán)境(比如用getInstance(Locale) )創(chuàng)建對象,必須實(shí)現(xiàn)以下類方法:?
public static Locale[] getAvailableLocales()
最后子類定義一個(gè)常量集合來標(biāo)識格式輸出中的不同字段遇汞。這些常量用于創(chuàng)建一個(gè)FieldPosition對象該對象標(biāo)識字段中所包含的信息及其在格式化結(jié)果中的位置未妹。這些常量應(yīng)當(dāng)命名為item_FIELD,其中item標(biāo)識了該字段空入。有關(guān)這些常量的例子络它,請參閱 ERA_FIELD及其在DateFormat中的同類。
格式通常不是同步的歪赢。建議為每個(gè)線程創(chuàng)建獨(dú)立的格式實(shí)例化戳。如果多個(gè)線程同時(shí)訪問一個(gè)格式,其它必須保持外部同步埋凯。
java.text.FieldPosition
構(gòu)造方法
public FieldPosition(int field)
為給定字段創(chuàng)建一個(gè)FieldPosition對象点楼。字段由常量標(biāo)識,在不同的Format子類中白对,常量名稱一般以_FIELD結(jié)尾掠廓。
public FieldPosition(Format.Field attribute)
為給定的字段常量創(chuàng)建一個(gè)FieldPosition對象。字段由不同F(xiàn)ormat子類中定義的常量來標(biāo)識甩恼。這等效于調(diào)用new FieldPosition(attribute, -1)蟀瞧。
public FieldPosition(Format.Field attribute,int fieldID)
為給定的字段創(chuàng)建一個(gè)FieldPosition對象。字段由來自Field的子類之一的屬性常量以及一個(gè)由Format的子類定義的整型字段ID標(biāo)識条摸。
當(dāng)attribute不為null時(shí)悦污,需要使用Field的Format子類應(yīng)當(dāng)優(yōu)先考慮attribute而忽略fieldID。
不過屈溉,舊的Format子類可能不知道Field而依靠fieldID。如果該字段沒有相應(yīng)的整型常量抬探,則fieldID應(yīng)為-1子巾。
FieldPosition是Format及其子類用于在格式輸出中(format(Object obj, StringBuffer toAppendTo, FieldPosition pos))標(biāo)識字段的簡單類。
FieldPosition保持對格式輸出中字段位置的兩個(gè)索引進(jìn)行跟蹤:字段的第一個(gè)字符的索引和緊跟字段的最后一個(gè)字符的索引小压。?
new FieldPosition(NumberFormat.INTEGER_FIELD);
stringBuffer1 = 1.235
?INTEGER:beginIndex=0,endIndex=1???? //索引位0-1(跟蹤索引位)
new FieldPosition(NumberFormat.FRACTION_FIELD);
stringBuffer2 = 1.235
FRACTION:beginIndex=2,endIndex=5?? //索引位2-5(跟蹤索引位)
不同的Format類中的format方法需要一個(gè)FieldPosition對象作為參數(shù)线梗。使用此format方法執(zhí)行部分格式化或者以獲取格式化輸出的信息(比如字段位置)。字段可以通過兩種方式標(biāo)識怠益,兩者的作用是一致的仪搔,只是Format.Field常量更詳細(xì),建議使用這種方式:?
1蜻牢、通過一個(gè)其名稱通常以_FIELD結(jié)尾的整型常量烤咧。這些常量在Format的不同子類中定義:?
NumberFormat
static int FRACTION_FIELD
? ? ? ? ? 用于構(gòu)造FieldPosition對象的字段常量偏陪。
static int INTEGER_FIELD
? ? ? ? ? 用于構(gòu)造FieldPosition對象的字段常量。
總結(jié):二者的跟蹤的索引位不同
例子:
public static void main(String[] args) {
????????//建立一個(gè)數(shù)字格式化對象
? ? ? ? NumberFormat numberFormat = NumberFormat.getInstance();
????????//建立字符數(shù)組緩沖器)—— 線程安全
? ? ? ? StringBuffer stringBuffer1 = new StringBuffer();
????????//數(shù)字格式化煮嫌,用于格式化時(shí)對索引跟蹤(第一個(gè)字符的索引笛谦,緊跟字段最后一個(gè)字符的索引)
? ? ? ? FieldPosition fieldPosition = new FieldPosition(NumberFormat.INTEGER_FIELD);
????????//十進(jìn)位小數(shù)對象
? ? ? ? BigDecimal bigDecimal = new BigDecimal("1.23456789");
????????//執(zhí)行格式化
? ? ? ? stringBuffer1 = numberFormat.format(bigDecimal, stringBuffer1, fieldPosition);
? ? ? ? System.out.println("stringBuffer1 = " + stringBuffer1);? //結(jié)果為1.235
????????//獲取索引
? ? ? ? System.out.println("INTEGER:beginIndex=" + fieldPosition.getBeginIndex() + ",endIndex=" + fieldPosition.getEndIndex());
? ? ? ? fieldPosition = new FieldPosition(NumberFormat.FRACTION_FIELD);
? ? ? ? StringBuffer stringBuffer2 = new StringBuffer();
? ? ? ? stringBuffer2 = numberFormat.format(bigDecimal, stringBuffer2, fieldPosition);
? ? ? ? System.out.println("stringBuffer2 = " + stringBuffer2);
? ? ? ? System.out.println("FRACTION:beginIndex=" + fieldPosition.getBeginIndex() + ",endIndex=" + fieldPosition.getEndIndex());
? ? }
結(jié)果為:
stringBuffer1 = 1.235
??INTEGER:beginIndex=0,endIndex=1???? //索引位0-1
stringBuffer2 = 1.235
FRACTION:beginIndex=2,endIndex=5?? //索引位2-5
2、通過一個(gè)Format.Field常量:標(biāo)識要格式化的類型是什么昌阿?
NumberFormat.Field
static NumberFormat.Field CURRENCY
? ? ? ? ? 標(biāo)識貨幣字段的常量饥脑。
static NumberFormat.Field DECIMAL_SEPARATOR
? ? ? ? ? 標(biāo)識小數(shù)點(diǎn)字段的常量。
static NumberFormat.Field EXPONENT
? ? ? ? ? 標(biāo)識指數(shù)字段的常量懦冰。
static NumberFormat.Field EXPONENT_SIGN
? ? ? ? ? 標(biāo)識指數(shù)符號 (exponent sign) 字段的常量灶轰。
static NumberFormat.Field EXPONENT_SYMBOL
? ? ? ? ? 標(biāo)識指數(shù)符號 (exponent symbol) 字段的常量。
static NumberFormat.Field FRACTION
? ? ? ? ? 標(biāo)識小數(shù)字段的常量刷钢。
static NumberFormat.Field GROUPING_SEPARATOR
? ? ? ? ? 標(biāo)識組分隔符字段的常量笋颤。
static NumberFormat.Field INTEGER
? ? ? ? ? 標(biāo)識整數(shù)字段的常量。
static NumberFormat.Field PERCENT
? ? ? ? ? 標(biāo)識百分?jǐn)?shù)字段的常量闯捎。
static NumberFormat.Field PERMILLE
? ? ? ? ? 標(biāo)識千分?jǐn)?shù)字段的常量椰弊。
static NumberFormat.Field SIGN
? ? ? ? ? 標(biāo)識符號字段的常量。
? FieldPosition pos = new FieldPosition(DateFormat.Field.DAY_OF_MONTH);
????????? 標(biāo)識日期字段的常量
public static void main(String[] args) {
? ? ? ? NumberFormat numberFormat = NumberFormat.getInstance();
? ? ? ? StringBuffer stringBuffer1 = new StringBuffer();
? ? ? ? FieldPosition fieldPosition = new FieldPosition(NumberFormat.Field.INTEGER);
? ? ? ? BigDecimal bigDecimal = new BigDecimal("1.23456789");
? ? ? ? stringBuffer1 = numberFormat.format(bigDecimal, stringBuffer1, fieldPosition);
? ? ? ? System.out.println("stringBuffer1 = " + stringBuffer1);
? ? ? ? System.out.println("INTEGER:beginIndex=" + fieldPosition.getBeginIndex() + ",endIndex=" + fieldPosition.getEndIndex());
? ? ? ? fieldPosition = new FieldPosition(NumberFormat.Field.FRACTION);
? ? ? ? StringBuffer stringBuffer2 = new StringBuffer();
? ? ? ? stringBuffer2 = numberFormat.format(bigDecimal, stringBuffer2, fieldPosition);
? ? ? ? System.out.println("stringBuffer2 = " + stringBuffer2);
? ? ? ? System.out.println("FRACTION:beginIndex=" + fieldPosition.getBeginIndex() + ",endIndex=" + fieldPosition.getEndIndex());
? ? }
輸出結(jié)果:
stringBuffer1 = 1.235
INTEGER:beginIndex=0,endIndex=1
stringBuffer2 = 1.235
FRACTION:beginIndex=2,endIndex=5
public static void main(String[] args) {
? ? ? ? DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG);
? ? ? ? StringBuffer stringBuffer = new StringBuffer();
? ? ? ? FieldPosition pos = new FieldPosition(DateFormat.Field.DAY_OF_MONTH);
? ? ? ? stringBuffer = dateFormat.format(new Date(), stringBuffer, pos);
? ? ? ? System.out.println("stringBuffer = " + stringBuffer);
? ? ? ? System.out.println("DATE_FIELD:beginIndex= " + pos.getBeginIndex() + ",endIndex=" + pos.getEndIndex());
? ? }
輸出結(jié)果:
stringBuffer = 2016年6月28日 上午11時(shí)07分18秒
DATE_FIELD:beginIndex= 7,endIndex=9
java.text.ParsePosition
ParsePosition是Format及其子類所使用的簡單類瓤鼻,用來在解析過程中跟蹤當(dāng)前位置秉版。各種Format類中的parseObject方法要求將 ParsePosition對象作為一個(gè)變量。解析具有不同格式的字符串時(shí)茬祷,可以使用同一個(gè)ParsePosition清焕,因?yàn)樗饕齾?shù)記錄的是當(dāng)前位置。ParsePosition也會記錄解析錯誤的位置祭犯。
構(gòu)造方法
public ParsePosition(int index)
創(chuàng)建一個(gè)具有給定初始索引的新 ParsePosition秸妥。
例子:
public static void main(String[] args) {
? ? ? ? SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
? ? ? ? String strings[] = {"xxx 2016-06-28 xxx1", "20160628 xxx2"};
? ? ? ? for (int i = 0; i < strings.length; i++) {
? ? ? ? ? ? ParsePosition parsePosition = new ParsePosition(4);//從第四位開始處理
? ? ? ? ? ? Date date = simpleDateFormat.parse(strings[i], parsePosition);
? ? ? ? ? ? //解析錯誤,返回null
? ? ? ? ? ? if (date == null) {
? ? ? ? ? ? ? ? System.out.println("無效日期:" + strings[i]);
? ? ? ? ? ? ? ? System.out.println("解析出錯的索引=" + parsePosition.getErrorIndex());
? ? ? ? ? ? ? ? System.out.println("當(dāng)前索引=" + parsePosition.getIndex());
? ? ? ? ? ? ? ? continue;
? ? ? ? ? ? }
? ? ? ? ? ? String substring = strings[i].substring(parsePosition.getIndex());
? ? ? ? ? ? System.out.println("日期=" + date + "沃粗,剩余部分:" + substring);
? ? ? ? }
? ? }
日期=Tue Jun 28 00:00:00 CST 2016粥惧,剩余部分: xxx1
無效日期:20160628 xxx2
解析出錯的索引=8
當(dāng)前索引=4
java.text.NumberFormat
NumberFormat 是所有數(shù)值格式的抽象基類。此類提供格式化和解析數(shù)值的接口最盅。NumberFormat 還提供了一些方法來確定哪些語言環(huán)境具有數(shù)值格式突雪,以及它們的名稱是什么。?
NumberFormat 可用于格式化和解析任何語言環(huán)境的數(shù)值涡贱。使代碼能夠完全獨(dú)立于小數(shù)點(diǎn)咏删、千位分隔符甚至所用特定小數(shù)位數(shù)的語言環(huán)境約定,并與數(shù)值格式是否為偶小數(shù)無關(guān)问词。
如何獲得一個(gè)實(shí)例督函?
NumberFormat總共有三種實(shí)例,常規(guī)數(shù)值、貨幣數(shù)值辰狡,百分比數(shù)值锋叨,每種都可以用默認(rèn)語言環(huán)境和指定語言環(huán)境。
常規(guī)數(shù)值:getInstance()(同getNumberInstance())搓译、getInstance(Locale inLocale)(同getNumberInstance(Locale inLocale))
貨幣數(shù)值:getCurrencyInstance()悲柱、getCurrencyInstance(Locale inLocale)
百分比數(shù)值:getPercentInstance()、getPercentInstance(Locale inLocale)
public static Locale[] getAvailableLocales()
返回一個(gè)當(dāng)前所支持的語言環(huán)境數(shù)組
void setCurrency(Currency currency)?
設(shè)置格式化貨幣值時(shí)此數(shù)值格式使用的貨幣些己。
void setGroupingUsed(boolean newValue)?
設(shè)置此格式中是否使用分組豌鸡,即是否有千位分隔符(逗號)。
void setMaximumFractionDigits(int newValue)?
設(shè)置數(shù)的小數(shù)部分所允許的最大位數(shù)段标。與解析無關(guān)涯冠。
void setMaximumIntegerDigits(int newValue)?
設(shè)置數(shù)的整數(shù)部分所允許的最大位數(shù)。與解析無關(guān)逼庞。
void setMinimumFractionDigits(int newValue)?
設(shè)置數(shù)的小數(shù)部分所允許的最小位數(shù)蛇更。與解析無關(guān)。
void setMinimumIntegerDigits(int newValue)?
設(shè)置數(shù)的整數(shù)部分所允許的最小位數(shù)赛糟。與解析無關(guān)派任。
void setParseIntegerOnly(boolean value)?
設(shè)置數(shù)是否應(yīng)該僅作為整數(shù)進(jìn)行解析。與格式化無關(guān)璧南。
例子:
public static void main(String[] args) throws Exception {
? ? ? ? //常規(guī)數(shù)值
? ? ? ? NumberFormat format1 = NumberFormat.getNumberInstance();
? ? ? ? System.out.println(format1.getMaximumIntegerDigits());//2147483647
? ? ? ? System.out.println(format1.getMinimumIntegerDigits());//1
? ? ? ? System.out.println(format1.getMaximumFractionDigits());//3
? ? ? ? System.out.println(format1.getMinimumFractionDigits());//0
? ? ? ? System.out.println(format1.isGroupingUsed());//true
? ? ? ? System.out.println(format1.isParseIntegerOnly());//false
? ? ? ? System.out.println(format1.format(10000000));//10,000,000 默認(rèn)分組
? ? ? ? System.out.println(format1.format(10000000.000));//10,000,000 小數(shù)點(diǎn)后全身0掌逛,被舍棄
? ? ? ? System.out.println(format1.format(10000000.001));//10,000,000.001
? ? ? ? System.out.println(format1.format(10000000.0001));//10,000,000 默認(rèn)最大小數(shù)位數(shù)是3位
? ? ? ? System.out.println(format1.parse("10000000.001"));//1.0000000001E7 默認(rèn)可以解析小數(shù)
? ? ? ? format1.setParseIntegerOnly(true);
? ? ? ? System.out.println(format1.parse("10000000.001"));//10000000
? ? ? ? //百分比數(shù)值
? ? ? ? NumberFormat format2 = NumberFormat.getPercentInstance();
? ? ? ? System.out.println(format2.getMaximumIntegerDigits());//2147483647
? ? ? ? System.out.println(format2.getMinimumIntegerDigits());//1
? ? ? ? System.out.println(format2.getMaximumFractionDigits());//0
? ? ? ? System.out.println(format2.getMinimumFractionDigits());//0
? ? ? ? System.out.println(format2.isGroupingUsed());//true
? ? ? ? System.out.println(format2.isParseIntegerOnly());//false
? ? ? ? System.out.println(format2.format(1.01));//101%
? ? ? ? System.out.println(format2.format(1.001));//100% 默認(rèn)最大小數(shù)位數(shù)是0
? ? ? ? format2.setMaximumFractionDigits(1);
? ? ? ? System.out.println(format2.format(1.001));//100.1%
? ? ? ? System.out.println(format2.parse("100.1%"));// 1.001 默認(rèn)可以解析小數(shù)
? ? ? ? //貨幣格式
? ? ? ? NumberFormat format3 = NumberFormat.getCurrencyInstance();
? ? ? ? System.out.println(format3.getMaximumIntegerDigits());//2147483647
? ? ? ? System.out.println(format3.getMinimumIntegerDigits());//1
? ? ? ? System.out.println(format3.getMaximumFractionDigits());//2
? ? ? ? System.out.println(format3.getMinimumFractionDigits());//2
? ? ? ? System.out.println(format3.isGroupingUsed());//true
? ? ? ? System.out.println(format3.isParseIntegerOnly());//false
? ? ? ? System.out.println(format3.format(10000));//¥10,000.00 默認(rèn)語言環(huán)境是zh_CN
? ? ? ? System.out.println(format3.parse("¥10,000.00"));//10000
? ? }
java.text.DecimalFormat
DecimalFormat是NumberFormat的一個(gè)具體子類,用于格式化十進(jìn)制數(shù)字司倚。該類設(shè)計(jì)有各種功能豆混,使其能夠解析和格式化任意語言環(huán)境中的數(shù),包括對西方語言动知、阿拉伯語和印度語數(shù)字的支持皿伺。通常不直接調(diào)用DecimalFormat的構(gòu)造方法,要獲取具體語言環(huán)境的DecimalFormat(包括默認(rèn)語言環(huán)境)盒粮,可調(diào)用NumberFormat的某個(gè)工廠方法鸵鸥,如getInstance()。如果看源碼會發(fā)現(xiàn)getInstance()其實(shí)返回的就是DecimalFormat實(shí)例丹皱,因?yàn)橐院蟮陌姹綨umberFormat的工廠方法可能返回不同于DecimalFormat的子類:?
NumberFormat f = NumberFormat.getInstance(loc);
if (f instanceof DecimalFormat) {
? ? ((DecimalFormat) f).setDecimalSeparatorAlwaysShown(true);
}
DecimalFormat包含一個(gè)模式和一組符號妒穴。可直接使用applyPattern()或間接使用API方法來設(shè)置模式种呐。符號存儲在DecimalFormatSymbols象中宰翅。如果想要改變符號弃甥,比如小數(shù)點(diǎn)爽室,可以使用和DecimalFormate關(guān)聯(lián)的DecimalFormatSymbols,此類表示了DecimalFormat格式化數(shù)字所需的符號集(如小數(shù)點(diǎn)、組分隔符等等)阔墩。DecimalFormat 根據(jù)其語言環(huán)境數(shù)據(jù)為其自身創(chuàng)建一個(gè)DecimalFormatSymbols實(shí)例嘿架。如果需要更改這些符號,可從DecimalFormat#getDecimalFormatSymbols()獲得DecimalFormatSymbols對象并修改它啸箫。通常程序員不需要修改DecimalFormatSymbols耸彪。
特殊符號
0
數(shù)字。阿拉伯?dāng)?shù)字忘苛,如果當(dāng)前位置不存在數(shù)字蝉娜,則顯示為0
#
數(shù)字。阿拉伯?dāng)?shù)字扎唾,在不影響數(shù)值的情況下召川,當(dāng)前位置如果為0或者不存在,則不顯示
.
數(shù)字胸遇。小數(shù)分隔符或貨幣小數(shù)分隔符
-
數(shù)字荧呐。減號
,
數(shù)字。分組分隔符
E
數(shù)字纸镊。分隔科學(xué)計(jì)數(shù)法中的尾數(shù)和指數(shù)倍阐。在前綴或后綴中無需加引號
;
子模式邊界。分隔正數(shù)和負(fù)數(shù)子模式
%
前綴或后綴逗威。乘以 100 并顯示為百分?jǐn)?shù)
\u2030
前綴或后綴峰搪。乘以 1000 并顯示為千分?jǐn)?shù)
¤(\u00A4)
前綴或后綴。貨幣記號庵楷,由貨幣符號替換罢艾。如果兩個(gè)同時(shí)出現(xiàn),則用國際貨幣符號替換尽纽。如果出現(xiàn)在某個(gè)模式中咐蚯,則使用貨幣小數(shù)分隔符,而不使用小數(shù)分隔符
‘
前綴或后綴弄贿。用于在前綴或或后綴中為特殊字符加引號春锋,例如 "‘#‘#" 將 123 格式化為 "#123"。要創(chuàng)建單引號本身差凹,請連續(xù)使用兩個(gè)單引號:"# o‘‘clock"
語法
1期奔、前綴和后綴:數(shù)字前后的符號,除 \uFFFE危尿、\uFFFF 和特殊字符以外的所有 Unicode 字符呐萌。
2、小數(shù)分隔符和千位分隔符應(yīng)該是不同的字符谊娇,否則將不可能進(jìn)行解析肺孤。
3、如果使用具有多個(gè)分組字符的模式,則最后一個(gè)分隔符和整數(shù)結(jié)尾之間的間隔才是使用的分組大小赠堵。所以 "#,##,###,####" == "######,####" == "##,####,####"小渊。?
構(gòu)造方法
DecimalFormat()?
使用默認(rèn)模式和默認(rèn)語言環(huán)境的符號創(chuàng)建一個(gè)DecimalFormat。?
DecimalFormat(String pattern)?
使用給定的模式和默認(rèn)語言環(huán)境的符號創(chuàng)建一個(gè)DecimalFormat茫叭。?
DecimalFormat(String pattern, DecimalFormatSymbols symbols)?
使用給定的模式和符號創(chuàng)建一個(gè)DecimalFormat酬屉。?
例子:
public static void main(String[] args) throws Exception {
? ? ? ? DecimalFormatSymbols unusualSymbols = new DecimalFormatSymbols();
? ? ? ? unusualSymbols.setDecimalSeparator(‘|‘);
? ? ? ? unusualSymbols.setGroupingSeparator(‘^‘);
? ? ? ? String strange = "#,##0.###";
? ? ? ? DecimalFormat weirdFormatter = new DecimalFormat(strange, unusualSymbols);
? ? ? ? weirdFormatter.setGroupingSize(4);
? ? ? ? String bizarre = weirdFormatter.format(12345.678);
? ? ? ? System.out.println(bizarre);//1^2345|678
? ? }