こんにちは、
それはJSLを使用して数字を含む文字列を削除する方法ですか?
例:
私はリンゴ4個とバナナ2本を食べました
型番は0998GBELSです
03/45はチェックする比率です
対象となる出力:
リンゴとバナナを食べました
型番は
チェックする比率です
これは機能しますが、正規表現に精通している人ならスクリプトを簡素化できるでしょう。
Names Default To Here( 1 );
theString = "I ate 4 apples and 2 bananas
the model number is 0998GBELS
03/45 is the ratio to check";
theList = Words( theString, " \!n\!r\!t" );
adjustedString = "";
For Each( {member}, theList,
Show( member );
//member=thelist[1]
found = "No";
If( !Contains( member, "0" ),
If( !Contains( member, "1" ),
If( !Contains( member, "2" ),
If( !Contains( member, "3" ),
If( !Contains( member, "4" ),
If( !Contains( member, "5" ),
If( !Contains( member, "6" ),
If( !Contains( member, "7" ),
If( !Contains( member, "8" ),
If( !Contains( member, "9" ),
adjustedString = Trim( adjustedString || " " || member )
)
)
)
)
)
)
)
)
)
);
);
Show( adjusted String );