Java Distance Calculate distinctFrom(String string, String other)

Here you can find the source of distinctFrom(String string, String other)

Description

distinct From

License

Apache License

Declaration

static String distinctFrom(String string, String other) 

Method Source Code

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

public class Main {
    static String distinctFrom(String string, String other) {
        if (string.equals(other)) {
            return 'a' + upcase(string);
        }/*from   w  w  w . ja  va2 s .c o m*/
        return string;
    }

    public static String upcase(String s) {
        if (s.isEmpty() || Character.isUpperCase(s.charAt(0))) {
            return s;
        }
        return Character.toUpperCase(s.charAt(0)) + s.substring(1);
    }
}

Related

  1. distExtraBits(int dist)
  2. distFrom(double lat1, double lng1, double lat2, double lng2)
  3. distFrom(double lat1, double lng1, double lat2, double lng2)
  4. distHalf(double angA, double angB)
  5. distHaversineRAD(double lat1, double lon1, double lat2, double lon2)
  6. distL1(double[] h1, double[] h2)
  7. distL1(int[] h1, int[] h2)
  8. distortion(double[] xvalues, double[] yvalues, int[] include)
  9. distpl(double A, double B, double C, double x, double y)