Java tutorial
//package com.java2s; /** * Appcelerator Titanium Mobile * Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved. * Licensed under the terms of the Apache Public License * Please see the LICENSE included with this distribution for details. */ public class Main { private static String getFilenameFromFontFamily(String fontFamily) { //Read that symbols can make the TypeFace load fail: so lowercase, then strip all but lowercase letters and numbers. return fontFamily.toLowerCase().replaceAll("[^a-z0-9]", ""); } }