我想用?更改%,反之亦然。以下两种方法都不起作用,原始字符串不会更改。
PayPal\Api\Payment Object (
[_propMap:PayPal\Common\PayPalModel:private] => Array (
[intent] => authorize [payer] => PayPal\Api\Payer Object (
[_propMap:PayPal\Common\PayPalModel:private] => Array (
[payment_method] => paypal
)
)
[redirect_urls] => PayPal\Api\RedirectUrls Object (
[_propMap:PayPal\Common\PayPalModel:private] => Array (
[return_url] => http://localhost/payment/payment-done
[cancel_url] => http://localhost/payment/payment-cancelled
)
)
[transactions] => Array (
[0] => PayPal\Api\Transaction Object (
[_propMap:PayPal\Common\PayPalModel:private] => Array (
[amount] => PayPal\Api\Amount Object (
[_propMap:PayPal\Common\PayPalModel:private] => Array (
[currency] => GBP
[details] => PayPal\Api\Details Object (
[_propMap:PayPal\Common\PayPalModel:private] => Array (
[shipping] => 1.20
[tax] => 1.30
[subtotal] => 17.50
)
)
[total] => 125
)
)
[item_list] => PayPal\Api\ItemList Object (
[_propMap:PayPal\Common\PayPalModel:private] => Array (
[items] => PayPal\Api\Item Object (
[_propMap:PayPal\Common\PayPalModel:private] => Array (
[name] => Job advertisement on Laravel
[description] => Job advertisement on Laravel
[currency] => GBP
[quantity] => 1
[tax] => 0.20
[price] => 125
)
)
)
)
[description] => Payment description
[invoice_number] => 599cd8d03b626
)
)
)
)
)
答案 0 :(得分:1)
你无法在makefile中使用反斜杠转义(至少不在函数调用中)。您正在尝试使用文字字符串\%
替换文字字符串\?
,并且因为您的字符串不包含任何\%
字符组合,所以没有任何反应。
对于subst
,您可以直接使用它们:
test = $(subst %,?,$(varStrg1))
test = $(subst ?,%,$(varStrg2))
我相信subst
函数中唯一特殊的字符是$
,,
和)
。
对于patsubst
,您无法将其用于此目的。