Skip to main content
edited tags
Link
Martin Tournoij
  • 63.3k
  • 26
  • 199
  • 274
Source Link

How do I alphabetically compare two strings

Is there a standard way to compare two strings in vim so that I can quickly determine which string is sorted before the other.

Something like

strcmp(str1, str2) 

to return 0 if str1 == str2, 1 if str1 > str2 and -1 if str1 < str2