2012-01-09 18 views
0

Sensetalk(Eggplant GUIテスターが使用するスクリプト言語)を使用してテキスト文字列を解析して分離する必要があります。Eggplant/Sensetalk大文字の単語を含む文字列の解析と分離

Put "MyTextIsHere" into exampleString 

そして、最初のセーブすべての大文字の前に挿入されたスペースを持っているので、次は、その後をexampleString に格納されています。私は何をできるようにしたいと思い、コードテキスト文字列を提供します:

"My Text Is Here" 

基本的には、文字列を含む単語に文字列を分割したいと考えています。ドキュメンテーションとウェブを検索した後、私はこれに対する解決策を見つけることに近づくことはありません(私は同意すると、別の言語でははるかに簡単です - 私の選択ではなく)。

事前に洞察力を提供していただきありがとうございます。

答えて

2

質問はhttp://www.testplant.com/phpBB2/viewtopic.php?t=2192でご覧ください。

set startingString to "HereAreMyWords" 
set myRange to 2 to the number of characters in startingString // The range to iterate over– every character except the first 

Put the first character in startingString into endString // The first character isn't included in the repeat loop, so you have to put it in separately 

repeat with each character myletter of characters myRange of startingString 
    if charToNum(myLetter) is between 65 and 90 // if the character's unicode number is between 65-90... 
     Put space after endString 
    end if 
    Put myLetter after endString 
end repeat 

put endString 

またはあなたはそれをこのように行うことができます:

Put "MyTextIsHere" into exampleString 
repeat with each char of chars 2 to last of exampleString by reference 
    if it is an uppercase then put space before it 
end repeat 
put exampleString 
TestPlantフォーラムでのパメラに信用して

関連する問題