gpt4 book ai didi

后记:连接两个字符串?

转载 作者:行者123 更新时间:2023-12-04 16:40:25 26 4
gpt4 key购买 nike

如何在 Postscript 中连接两个字符串?

(foo) (bar) ??? -> (foobar)

最佳答案

PostScript 没有内置的字符串连接运算符。您需要为此编写一些代码。见 http://en.wikibooks.org/wiki/PostScript_FAQ#How_to_concatenate_strings.3F例如。

(由 mh 更新:复制到此处)

 /concatstrings % (a) (b) -> (ab)  
{ exch dup length
2 index length add string
dup dup 4 2 roll copy length
4 -1 roll putinterval
} bind def

关于后记:连接两个字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12378904/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com