/* string_ops.d Author: Justin C Calvarese Date: October 7, 2003 License: Public Domain Compiles with DMD v0.73 under WindowsXP. */ int main() { char[] str1 = "Aardvark"; char[] str2 = "Zebra"; char[] str3 = "1"; /* less than operator */ if ( str1 < str2 ) printf("Aardvark comes before Zebra.\n"); else printf("Aardvark comes after Zebra.\n"); /* greater than operator */ if ( str1 > str2 ) printf("Aardvark comes after Zebra.\n"); else printf("Aardvark comes before Zebra.\n"); /* equality operator */ if ( str1 == str2 ) printf("Aardvark is Zebra?!\n"); else printf("Aardvark is NOT Zebra.\n"); /* string concatenation */ for (int i=0; i<3; i++) str3 ~= "0"; printf("%.*s\n", str3); return 0; }