سؤال

Is there a function in Coldfusion that will take 2 strings and figure out which is the 'higher' alphabetically . So if I had "Daniel" and "John", it would return Daniel?

هل كانت مفيدة؟

المحلول

Put your strings into an array then use arraySort(). (example not tested)

var names = ['Daniel', 'John'];
arraySort( names, 'textnocase' );
writeOutput(names[1]);
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top