package fr.sciencespo.medialab.hci.memorystructure.util;

import java.lang.String;
import java.lang.StringBuffer;

/**
 * Utility methods for Strings.
 *
 * @author benjamin ooghe-tabanou
 */
public class StringUtil {

    public static String toProperCase(String text) {
        text = text.toLowerCase();
        text = text.substring(0, 1).toUpperCase();
        return text;
    }

    public static String toTitle(String text) {
        StringBuffer output = new StringBuffer();
        String[] tokens = text.split(" ");
        for (int i=0; i<tokens.length; i++) {
            output.append(toProperCase(tokens[i]));
        }
        return output.toString();
    }

}

@@ -341,32 +341,66 @@
 1).toUpperCase()
+ + text.substring(1).toLowerCase()
 ;%0A        return
@@ -542,16 +542,34 @@
  = text.
+replace(%22.%22, %22 %22).
 split(%22 
@@ -644,16 +644,20 @@
 .append(
+%22 %22+
 toProper
@@ -716,16 +716,23 @@
 String()
+.trim()
 ;%0A    %7D%0A

fix proper case names for webentities created by Memory Structure