【发布时间】:2014-09-19 15:44:54
【问题描述】:
我有一个字符串
$description = 'Front: 1 1/2" W x 1" H ... Back: 2 1/4" W x 1 1/4" H Standard Imprint Area is the front. Optional Imprint Area is the back. Imprint on Standard Location Unless Otherwise Specified on Order. For Printing on Both Positions, Add $40.00(G) Set Up Plus .25(G) Per Piece.'
我需要将字符串修剪为包含文本“可选印记”作为最后一句的句子。
因此,如果文本包含“可选印记”,则找到句子的结尾,并丢弃它的结尾点之后的所有字符,句号(.)。
我需要从上面的例子返回的是:
$description = 'Front: 1 1/2" W x 1" H ... Back: 2 1/4" W x 1 1/4" H Standard Imprint Area is the front. Optional Imprint Area is the back.'
【问题讨论】:
-
您是否总是希望它在第二个周期后修剪?这个文本可以是动态的吗?提供更多细节。