Tabnine Logo
String.compareToIgnoreCase
Code IndexAdd Tabnine to your IDE (free)

How to use
compareToIgnoreCase
method
in
java.lang.String

Best Java code snippets using java.lang.String.compareToIgnoreCase (Showing top 20 results out of 12,501)

origin: jenkinsci/jenkins

/**
 * Sort by short name.
 */
public int compareTo(PluginWrapper pw) {
  return shortName.compareToIgnoreCase(pw.shortName);
}
origin: jenkinsci/jenkins

public int compare(String lhs, String rhs) {
  return lhs.compareToIgnoreCase(rhs);
}
origin: apache/zeppelin

 @Override
 public int compare(String o1, String o2) {
  return o1.compareToIgnoreCase(o2);
 }
});
origin: jenkinsci/jenkins

  protected int compare(long idA, long idB) {
    String tga = map.get(idA), tgb = map.get(idB);
    int result = (tga!=null?-1:0) + (tgb!=null?1:0);  // Will be non-zero if only one is null
    if (result==0 && tga!=null)
      result = tga.compareToIgnoreCase(tgb);
    return result;
  }
}
origin: ReactiveX/RxJava

  @Override
  public boolean test(String a, String b) {
    return a.compareToIgnoreCase(b) == 0;
  }
})
origin: ReactiveX/RxJava

  @Override
  public boolean test(String a, String b) {
    return a.compareToIgnoreCase(b) == 0;
  }
})
origin: commons-io/commons-io

/**
 * Compares two strings using the case-sensitivity rule.
 * <p>
 * This method mimics {@link String#compareTo} but takes case-sensitivity
 * into account.
 *
 * @param str1  the first string to compare, not null
 * @param str2  the second string to compare, not null
 * @return true if equal using the case rules
 * @throws NullPointerException if either string is null
 */
public int checkCompareTo(final String str1, final String str2) {
  if (str1 == null || str2 == null) {
    throw new NullPointerException("The strings must not be null");
  }
  return sensitive ? str1.compareTo(str2) : str1.compareToIgnoreCase(str2);
}
origin: apache/incubator-dubbo

  @Override
  public int compare(String s1, String s2) {
    if (s1 == null && s2 == null) {
      return 0;
    }
    if (s1 == null) {
      return -1;
    }
    if (s2 == null) {
      return 1;
    }
    int i1 = s1.lastIndexOf('.');
    if (i1 >= 0) {
      s1 = s1.substring(i1 + 1);
    }
    int i2 = s2.lastIndexOf('.');
    if (i2 >= 0) {
      s2 = s2.substring(i2 + 1);
    }
    return s1.compareToIgnoreCase(s2);
  }
};
origin: apache/incubator-dubbo

  @Override
  public int compare(String s1, String s2) {
    if (s1 == null && s2 == null) {
      return 0;
    }
    if (s1 == null) {
      return -1;
    }
    if (s2 == null) {
      return 1;
    }
    int i1 = s1.lastIndexOf('.');
    if (i1 >= 0) {
      s1 = s1.substring(i1 + 1);
    }
    int i2 = s2.lastIndexOf('.');
    if (i2 >= 0) {
      s2 = s2.substring(i2 + 1);
    }
    return s1.compareToIgnoreCase(s2);
  }
};
origin: jenkinsci/jenkins

  public int compare(Thread a, Thread b) {
    int result = compare(a.getId(), b.getId());
    if (result == 0)
      result = a.getName().compareToIgnoreCase(b.getName());
    return result;
  }
}
origin: jenkinsci/jenkins

  public int compare(ThreadInfo a, ThreadInfo b) {
    int result = compare(a.getThreadId(), b.getThreadId());
    if (result == 0)
      result = a.getThreadName().compareToIgnoreCase(b.getThreadName());
    return result;
  }
}
origin: redisson/redisson

  public int compare(File file1, File file2) {
    String ext1 = FileNameUtil.getExtension(file1.getName());
    String ext2 = FileNameUtil.getExtension(file2.getName());
    long diff = ext1.compareToIgnoreCase(ext2);
    if (diff == 0) {
      return 0;
    }
    if (diff > 0) {
      return order;
    }
    return -order;
  }
}
origin: jenkinsci/jenkins

/**
 * Does case-insensitive comparison.
 * {@inheritDoc}
 */
@Override public final int compareTo(VirtualFile o) {
  return getName().compareToIgnoreCase(o.getName());
}
origin: jenkinsci/jenkins

@Override public int compare(Item i1, Item i2) {
  return name(i1).compareToIgnoreCase(name(i2));
}
origin: jenkinsci/jenkins

@Override public int compare(Item i1, Item i2) {
  return name(i1).compareToIgnoreCase(name(i2));
}
origin: jenkinsci/jenkins

public int compareTo(PluginEntry o) {
  int r = category.compareTo(o.category);
  if (r==0) r = plugin.name.compareToIgnoreCase(o.plugin.name);
  if (r==0) r = new VersionNumber(plugin.version).compareTo(new VersionNumber(o.plugin.version));
  return r;
}
origin: TeamNewPipe/NewPipe

private List<InfoItem> getSubscriptionItems(List<SubscriptionEntity> subscriptions) {
  List<InfoItem> items = new ArrayList<>();
  for (final SubscriptionEntity subscription : subscriptions) {
    items.add(subscription.toChannelInfoItem());
  }
  Collections.sort(items,
      (InfoItem o1, InfoItem o2) ->
          o1.getName().compareToIgnoreCase(o2.getName()));
  return items;
}
origin: alibaba/Sentinel

@Override
public int compareTo(MachineInfo o) {
  if (this == o) {
    return 0;
  }
  if (!port.equals(o.getPort())) {
    return port.compareTo(o.getPort());
  }
  if (!StringUtil.equals(app, o.getApp())) {
    return app.compareToIgnoreCase(o.getApp());
  }
  return ip.compareToIgnoreCase(o.getIp());
}
origin: Alluxio/alluxio

 @Override
 public int compare(BlockWorkerInfo o1, BlockWorkerInfo o2) {
  return o1.getNetAddress().toString().compareToIgnoreCase(o2.getNetAddress().toString());
 }
});
origin: apache/hbase

 @Override
 public int compare(ServerName o1, ServerName o2) {
  int compare = o1.getHostname().compareToIgnoreCase(o2.getHostname());
  if (compare != 0) return compare;
  compare = o1.getPort() - o2.getPort();
  if (compare != 0) return compare;
  return 0;
 }
}
java.langStringcompareToIgnoreCase

Javadoc

Compares two strings lexicographically, ignoring case differences. This method returns an integer whose sign is that of calling compareTo with normalized versions of the strings where case differences have been eliminated by calling Character.toLowerCase(Character.toUpperCase(character)) on each character.

Note that this method does not take locale into account, and will result in an unsatisfactory ordering for certain locales. The java.text package provides collators to allow locale-sensitive ordering.

Popular methods of String

  • equals
  • length
    Returns the number of characters in this string.
  • substring
    Returns a string containing a subsequence of characters from this string. The returned string shares
  • startsWith
    Compares the specified string to this string, starting at the specified offset, to determine if the
  • format
    Returns a formatted string, using the supplied format and arguments, localized to the given locale.
  • split
    Splits this string using the supplied regularExpression. See Pattern#split(CharSequence,int) for an
  • trim
  • valueOf
    Creates a new string containing the specified characters in the character array. Modifying the chara
  • indexOf
  • endsWith
    Compares the specified string to this string to determine if the specified string is a suffix.
  • toLowerCase
    Converts this string to lower case, using the rules of locale.Most case mappings are unaffected by t
  • contains
    Determines if this String contains the sequence of characters in the CharSequence passed.
  • toLowerCase,
  • contains,
  • getBytes,
  • <init>,
  • equalsIgnoreCase,
  • replace,
  • isEmpty,
  • charAt,
  • hashCode,
  • lastIndexOf

Popular in Java

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getResourceAsStream (ClassLoader)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Socket (java.net)
    Provides a client-side TCP socket.
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now