Java String Format format(String s)

Here you can find the source of format(String s)

Description

format

License

Open Source License

Declaration

public static String format(String s) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static String format(String s) {
        String[] fullNameSplit = s.split("_| ");
        List<String> fullNameList = new ArrayList<String>();

        for (String f : fullNameSplit) {
            fullNameList.add(f);//w  w  w  . j  a v  a  2 s . c  om
        }

        String name = "";

        for (String f : fullNameList) {
            name = name + f.replace(f.substring(1), f.substring(1).toLowerCase());
            name = name + " ";
        }
        name = name.trim();
        return name;
    }
}

Related

  1. format(final String message, final Object... args)
  2. format(final String s, final int width, final int intend)
  3. format(String longMessage, int charPerLine, int paddingLeft, boolean padFirstLine)
  4. format(String name, char separator)
  5. format(String name, char separator, String prefix, boolean includePrefix, boolean includeLeadingSeparator)
  6. format(String source, String placeholder, Object... objs)
  7. format(String string)
  8. formatCommand(String cmd)
  9. formatDescriptors(String descriptorString)