Chromium Code Reviews| Index: components/autofill/core/browser/credit_card.cc |
| diff --git a/components/autofill/core/browser/credit_card.cc b/components/autofill/core/browser/credit_card.cc |
| index b4c1c9eb2ccc4fd56c4fd559c7d8982198e033b0..1d1a84a4bb20867e39cc44cc634fad8071440a34 100644 |
| --- a/components/autofill/core/browser/credit_card.cc |
| +++ b/components/autofill/core/browser/credit_card.cc |
| @@ -448,9 +448,10 @@ void CreditCard::SetInfoForMonthInputType(const base::string16& value) { |
| return; |
| } |
| - std::vector<base::string16> year_month; |
| - base::SplitString(value, L'-', &year_month); |
| - DCHECK_EQ((int)year_month.size(), 2); |
| + std::vector<base::StringPiece16> year_month = base::SplitStringPiece( |
| + value, base::ASCIIToUTF16("-"), |
| + base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL); |
|
yzshen1
2015/07/22 22:50:34
TRIM_WHITESPACE
|
| + DCHECK_EQ(2u, year_month.size()); |
| int num = 0; |
| bool converted = false; |
| converted = base::StringToInt(year_month[0], &num); |