SKETCHWARE | Change Text to Sentence Case Get link Facebook X Pinterest Email Other Apps February 22, 2020 Source code: Wrap | Copy String str = edittext1.getText().toString(); StringBuilder result = new StringBuilder(); boolean capitalize = true; for(char c : str.toCharArray()) { if (capitalize) { result.append(Character.toUpperCase(c)); if (!Character.isWhitespace(c) && c != '\r' && c != '\n' && c != '.' && c != '"' && c != '?' && c != '!') { capitalize = false; } } else { result.append(c); if (c == '\r' | c == '\n' | c == '.' | c == '"' | c == '?' | c == '!') { capitalize = true; } } } edittext1.setText(result.toString()); By clicking “Send Question”, you agree to: Use polite and non coercive words. Serious in asking about the problem. Send Question Get link Facebook X Pinterest Email Other Apps