diff --git a/src/com/android/contacts/common/format/FormatUtils.java b/src/com/android/contacts/common/format/FormatUtils.java
index 6a274de..376ff13 100644
--- a/src/com/android/contacts/common/format/FormatUtils.java
+++ b/src/com/android/contacts/common/format/FormatUtils.java
@@ -138,13 +138,13 @@
      * @param text the text in which to search for the prefix
      * @param prefix the text to find, in upper case letters
      */
-    public static int indexOfWordPrefix(CharSequence text, char[] prefix) {
+    public static int indexOfWordPrefix(CharSequence text, String prefix) {
         if (prefix == null || text == null) {
             return -1;
         }
 
         int textLength = text.length();
-        int prefixLength = prefix.length;
+        int prefixLength = prefix.length();
 
         if (prefixLength == 0 || textLength < prefixLength) {
             return -1;
@@ -164,7 +164,7 @@
             // Compare the prefixes
             int j;
             for (j = 0; j < prefixLength; j++) {
-                if (Character.toUpperCase(text.charAt(i + j)) != prefix[j]) {
+                if (Character.toUpperCase(text.charAt(i + j)) != prefix.charAt(j)) {
                     break;
                 }
             }
diff --git a/src/com/android/contacts/common/format/PrefixHighlighter.java b/src/com/android/contacts/common/format/PrefixHighlighter.java
index 65edf58..ce44d65 100644
--- a/src/com/android/contacts/common/format/PrefixHighlighter.java
+++ b/src/com/android/contacts/common/format/PrefixHighlighter.java
@@ -39,7 +39,7 @@
      * @param text the string to use as the text
      * @param prefix the prefix to look for
      */
-    public void setText(TextView view, String text, char[] prefix) {
+    public void setText(TextView view, String text, String prefix) {
         view.setText(apply(text, prefix));
     }
 
@@ -49,15 +49,27 @@
      * @param text the text to which to apply the highlight
      * @param prefix the prefix to look for
      */
-    public CharSequence apply(CharSequence text, char[] prefix) {
-        int index = FormatUtils.indexOfWordPrefix(text, prefix);
+    public CharSequence apply(CharSequence text, String prefix) {
+        if (prefix == null) {
+            return text;
+        }
+
+        // Skip non-word characters at the beginning of prefix.
+        int prefixStart = 0;
+        while (prefixStart < prefix.length() &&
+                !Character.isLetterOrDigit(prefix.charAt(prefixStart))) {
+            prefixStart++;
+        }
+        final String trimmedPrefix = prefix.substring(prefixStart);
+
+        int index = FormatUtils.indexOfWordPrefix(text, trimmedPrefix);
         if (index != -1) {
             if (mPrefixColorSpan == null) {
                 mPrefixColorSpan = new ForegroundColorSpan(mPrefixHighlightColor);
             }
 
             SpannableString result = new SpannableString(text);
-            result.setSpan(mPrefixColorSpan, index, index + prefix.length, 0 /* flags */);
+            result.setSpan(mPrefixColorSpan, index, index + trimmedPrefix.length(), 0 /* flags */);
             return result;
         } else {
             return text;
diff --git a/src/com/android/contacts/common/list/ContactEntryListAdapter.java b/src/com/android/contacts/common/list/ContactEntryListAdapter.java
index 22a17a7..9ebf9a2 100644
--- a/src/com/android/contacts/common/list/ContactEntryListAdapter.java
+++ b/src/com/android/contacts/common/list/ContactEntryListAdapter.java
@@ -71,7 +71,7 @@
     private ContactPhotoManager mPhotoLoader;
 
     private String mQueryString;
-    private char[] mUpperCaseQueryString;
+    private String mUpperCaseQueryString;
     private boolean mSearchMode;
     private int mDirectorySearchMode;
     private int mDirectoryResultLimit = Integer.MAX_VALUE;
@@ -225,11 +225,11 @@
         if (TextUtils.isEmpty(queryString)) {
             mUpperCaseQueryString = null;
         } else {
-            mUpperCaseQueryString = queryString.toUpperCase().toCharArray();
+            mUpperCaseQueryString = queryString.toUpperCase();
         }
     }
 
-    public char[] getUpperCaseQueryString() {
+    public String getUpperCaseQueryString() {
         return mUpperCaseQueryString;
     }
 
diff --git a/src/com/android/contacts/common/list/ContactListItemView.java b/src/com/android/contacts/common/list/ContactListItemView.java
index 5c2943f..8354fd9 100644
--- a/src/com/android/contacts/common/list/ContactListItemView.java
+++ b/src/com/android/contacts/common/list/ContactListItemView.java
@@ -139,7 +139,7 @@
 
     private ColorStateList mSecondaryTextColor;
 
-    private char[] mHighlightedPrefix;
+    private String mHighlightedPrefix;
 
     private int mDefaultPhotoViewSize = 0;
     /**
@@ -813,7 +813,7 @@
      * <p>
      * NOTE: must be all upper-case
      */
-    public void setHighlightedPrefix(char[] upperCasePrefix) {
+    public void setHighlightedPrefix(String upperCasePrefix) {
         mHighlightedPrefix = upperCasePrefix;
     }
 
@@ -1176,7 +1176,6 @@
                 }
             }
         } else {
-
             if (snippet != null) {
                 int from = 0;
                 int to = snippet.length();
diff --git a/tests/src/com/android/contacts/common/format/FormatUtilsTests.java b/tests/src/com/android/contacts/common/format/FormatUtilsTests.java
index b38019d..8f4f772 100644
--- a/tests/src/com/android/contacts/common/format/FormatUtilsTests.java
+++ b/tests/src/com/android/contacts/common/format/FormatUtilsTests.java
@@ -76,7 +76,7 @@
     }
 
     public void testIndexOfWordPrefix_NullText() {
-        assertEquals(-1, FormatUtils.indexOfWordPrefix(null, "TE".toCharArray()));
+        assertEquals(-1, FormatUtils.indexOfWordPrefix(null, "TE"));
     }
 
     public void testIndexOfWordPrefix_MatchingPrefix() {
@@ -109,6 +109,6 @@
      * @param expectedIndex the expected value to be returned by the function
      */
     private void checkIndexOfWordPrefix(String text, String wordPrefix, int expectedIndex) {
-        assertEquals(expectedIndex, FormatUtils.indexOfWordPrefix(text, wordPrefix.toCharArray()));
+        assertEquals(expectedIndex, FormatUtils.indexOfWordPrefix(text, wordPrefix));
     }
 }
diff --git a/tests/src/com/android/contacts/common/list/ContactListItemViewTest.java b/tests/src/com/android/contacts/common/list/ContactListItemViewTest.java
index 6eb74db..a452460 100644
--- a/tests/src/com/android/contacts/common/list/ContactListItemViewTest.java
+++ b/tests/src/com/android/contacts/common/list/ContactListItemViewTest.java
@@ -76,7 +76,7 @@
         Cursor cursor = createCursor("John Doe", "Doe John");
         ContactListItemView view = createView();
 
-        view.setHighlightedPrefix("DOE".toCharArray());
+        view.setHighlightedPrefix("DOE");
         view.showDisplayName(cursor, 0, ContactsContract.Preferences.DISPLAY_ORDER_PRIMARY);
 
         CharSequence seq = view.getNameTextView().getText();
@@ -88,7 +88,7 @@
         Cursor cursor = createCursor("John Doe", "Doe John");
         ContactListItemView view = createView();
 
-        view.setHighlightedPrefix("DOE".toCharArray());
+        view.setHighlightedPrefix("DOE");
         view.showDisplayName(cursor, 0, ContactsContract.Preferences.DISPLAY_ORDER_ALTERNATIVE);
 
         CharSequence seq = view.getNameTextView().getText();
@@ -98,7 +98,7 @@
 
     public void testSetSnippet_Prefix() {
         ContactListItemView view = createView();
-        view.setHighlightedPrefix("TEST".toCharArray());
+        view.setHighlightedPrefix("TEST");
         view.setSnippet("This is a test");
 
         CharSequence seq = view.getSnippetView().getText();
