Java String Sanitize sanitizeUserEmail(String userEmail)

Here you can find the source of sanitizeUserEmail(String userEmail)

Description

Method sanitizeUserEmail cleans the userEmail from something like "john.ichat@rides.openfire/edbbeb61" to "john.ichat@rides.openfire"

License

Apache License

Parameter

Parameter Description
userEmail the User's Email for Ride.ca account

Return

a sanitized Email String

Declaration

public static String sanitizeUserEmail(String userEmail) 

Method Source Code

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

public class Main {
    /**//w w  w .  j  a v  a 2 s  .c  om
     * Method sanitizeUserEmail cleans the userEmail from something like "john.ichat@rides.openfire/edbbeb61" to
     * "john.ichat@rides.openfire"
     * @param userEmail the User's Email for Ride.ca account
     * @return a sanitized Email String
     */
    public static String sanitizeUserEmail(String userEmail) {
        String sanitizedUserEmail = null;
        if (userEmail.contains("/")) {
            sanitizedUserEmail = userEmail.substring(0, userEmail.indexOf("/"));
        } else {
            sanitizedUserEmail = userEmail;
        }
        return sanitizedUserEmail;
    }
}

Related

  1. sanitizeToLineFeed(CharSequence string)
  2. sanitizeToLong(String origMSISDN)
  3. sanitizeToString(String origMSISDN)
  4. sanitizeTypename(String name)
  5. sanitizeUnicode(String str)
  6. sanitizeUserName(final String userName)
  7. sanitizeVersion(String inVer)
  8. sanitizeWebOutput(String text)
  9. sanitizeYear(int yr)