My source is in order, is yours?
Brachylog, 2 bytes
.o
Try it online!
Explanation
.o
. Assert that {the input} equals the output of the last command in the program
o Sort {the input}
As a full program, an assertion failure gives false.
, any successful run that doesn't violate any assertions gives true.
Jelly, 2 bytes
Ṣ⁼
Try it online!
Explanation
Ṣ⁼
Ṣ Sort {the input}
⁼ Compare that to {the input} for equality of the whole structure
⁼Ṣ
also has the right functionality ("compare the input to the sorted input"), so it was just a case of running the two programs on themselves to figure out which was in order (I certainly don't have the Unicode codepoints of this part of Jelly's weird character set memorized).
MATL, 5 bytes
GGS\a
Outputs 0
if input is in order, 1
otherwise.
Try it online!
Explanation
This computes the modulus of (the code points of) each char from the input with that at the same index in the sorted input. The input is in order if and only if all results are 0
.
For example, consider the input string BCD!
. Sorting it gives '!BCD
. The arrays of code points are respectively [66 67 68 33]
and [33 66 67 68]
. Computing the moduli gives [0 1 1 33]
, so the input is not in order. Note how some results can be 0
even if the values were not the same (here that happens at the first position), but that cannot happen in all entries unless the input is in order.
G % Push input string
GS % Push input string and sort it
\ % Modulus, element-wise. This gives all zeros iff the input was in order
a % Any: gives 1 if any entry is non-zero. Implicitly display