From 827b24b0ee0e509f18924f92a5c730c1951b1562 Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 1 Apr 2015 06:57:52 -0700 Subject: [PATCH] add capitalize() --- .../XWords4/src/org/eehouse/android/xw4/Utils.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/Utils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/Utils.java index c961280dc..8f9b6a8cd 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/Utils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/Utils.java @@ -273,6 +273,14 @@ public class Utils { return name; } + public static String capitalize( String str ) + { + if ( null != str && 0 < str.length() ) { + str = str.substring( 0, 1 ).toUpperCase() + str.substring( 1 ); + } + return str; + } + public static void setChecked( Dialog dialog, int id, boolean value ) { CheckBox cbx = (CheckBox)dialog.findViewById( id );