Skip to main content

文字列.比較.LessThan,GreaterThan(辞書順)

Python

py
<

Swift

swift
<

String の場合はこれで良いが、NSString の場合は compare() を使う? 使うことあるだろうか。 xxxxinsensitive 系の options 指定するときぐらいか。

Bash

[ \< ] または [[ < ]]

bash
if [ "$a" \< "$b" ]
bash
if [[ "$a" < "$b" ]]

Ruby

rb
<