Java tutorial
//package com.java2s; //License from project: Open Source License import android.text.Spannable; import android.text.SpannableString; import android.text.style.StyleSpan; public class Main { public static CharSequence italic(CharSequence sequence) { return italic(sequence, sequence.length()); } public static CharSequence italic(CharSequence sequence, int length) { SpannableString spannable = new SpannableString(sequence); spannable.setSpan(new StyleSpan(android.graphics.Typeface.ITALIC), 0, length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); return spannable; } }