delimitersを使った検索置換

| コメント(0)
set OriginalDelimiters to AppleScript's text item delimiters
	
	set KEN to return --検索文字
	set TIKAN to "" --置換文字
	set AppleScript's text item delimiters to {KEN}
	set TexData to text items of TexData
	set AppleScript's text item delimiters to {TIKAN}
	set TexData to TexData as string
	
	set AppleScript's text item delimiters to OriginalDelimiters

on replaceAll(motoStr, FindStr, repStr)
	set OriginalDelimiters to AppleScript's text item delimiters
	set AppleScript's text item delimiters to {FindStr}
	set motoStr to text items of motoStr
	set AppleScript's text item delimiters to {repStr}
	set motoStr to motoStr as string
	set AppleScript's text item delimiters to OriginalDelimiters
	return motoStr
end replaceAll
Comments are nofollow setting

コメントする

エントリー一覧

OpenID対応しています OpenIDについて
Powered by Movable Type 8.0.2
漢字イラストロジック-脳トレ京
FREE ONLINE SUDOKU