AppleScript名:NFKC Casefoldの影響を除外した文字列比較 |
use AppleScript version "2.4" use framework "Foundation" use scripting additions set a to "㍑" set b to "リットル" log (a = b) –AppleScriptネイティブの文字列比較だとこれらが混同されることに注意 –> true set c to compStrA_B_(a, b) –> false set a to "バビブベボ" set b to "ハヒフヘホ" log (a = b) –> false set c to compStrA_B_(a, b) –> false set a to "あいうえお" set b to "アイウエオ" log (a = b) –AppleScriptネイティブの文字列比較だとこれらが混同されることに注意 –> true set c to compStrA_B_(a, b) –> false –文字列比較をASOC(Cocoa)とAppleScriptで実施するテストルーチン on compStrA:a b:b set aStr to current application’s NSString’s stringWithString:a set bStr to current application’s NSString’s stringWithString:b return (aStr’s isEqualToString:bStr) as boolean end compStrA:b: |
More from my site
(Visited 63 times, 1 visits today)