【发布时间】:2014-01-24 02:51:29
【问题描述】:
我有以下日期:
"Friday, January 31",
"Wednesday, February 12",
"Monday, February 17",
"Wednesday, March 5",
我想设置一个字符串函数,总是给我一个数字:
31
12
17
5
我从这个函数开始:
String strCheck = suspendedDates[i];
int pos = strCheck.length();
int pos2 = strCheck.indexOf(" ");
我现在卡住了,因为它怎么知道是哪个" "?
谁能帮我完成这个功能。
【问题讨论】:
-
如文档所述,它将采用第一个。 "返回此字符串中第一次出现指定子字符串的索引。"