Java String Sanitize sanitizeOperationId(String operationId)

Here you can find the source of sanitizeOperationId(String operationId)

Description

sanitize Operation Id

License

Apache License

Declaration

public static String sanitizeOperationId(String operationId) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String sanitizeOperationId(String operationId) {
        StringBuffer result = new StringBuffer();
        for (int i = 0; i < operationId.length(); i++) {
            char c = operationId.charAt(i);
            if (c == '-' || c == ' ' || c == '_') {
                try {
                    while (c == '-' || c == ' ' || c == '_') {
                        i++;/*from   w w w  . j a va  2 s.  c o  m*/
                        c = operationId.charAt(i);
                    }
                    result.append(Character.toUpperCase(operationId.charAt(i)));
                } catch (StringIndexOutOfBoundsException e) {
                }
            } else {
                result.append(c);
            }
        }
        return result.toString();
    }
}

Related

  1. sanitizeName(String name)
  2. sanitizeName(String name)
  3. sanitizeName(String name)
  4. sanitizeName(String origName)
  5. sanitizeNamespace(String namespace)
  6. sanitizePackageName(String raw)
  7. sanitizePackageVersion(String string)
  8. sanitizePath(String apiPath)
  9. sanitizePath(String input)