Created
March 27, 2020 14:33
-
-
Save parthsarthiprasad/cd9305f1fa984e26d07a9bfeb132d651 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use String; | |
use ByteBufferHelpers; | |
inline proc doComp(a: ?t1, b: ?t2, c:int, d:int) { | |
return _strcmp(a.buff+c-1, d-c+1, a.locale_id, b.buff, b.len, b.locale_id) == 0; | |
} | |
var i : string = "asdfasdf5"; | |
var j : string = "asdf"; | |
if doComp(i, j, 1, 5) | |
{writeln(true);} | |
else | |
{writeln(false);} | |
if doComp(i, j, 1, 4) | |
{writeln(true);} | |
else | |
{writeln(false);} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment