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..6f26a14ee36fe0051f209f6612b14c56a8bb1e8f 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::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
+ DCHECK_EQ(2u, year_month.size()); |
int num = 0; |
bool converted = false; |
converted = base::StringToInt(year_month[0], &num); |