后记:连接两个字符串? [英] Postscript: concatenate two strings?
本文介绍了后记:连接两个字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Postscript中连接两个字符串?
How do I concatenate two strings in Postscript?
(foo) (bar) ??? -> (foobar)
推荐答案
PostScript没有内置的在字符串连接运算符中。您需要为此编写一些代码。参见 http://en.wikibooks.org/wiki/PostScript_FAQ#How_to_concatenate_strings.3F
PostScript doesn't have a built-in string concatenation operator. You need to write some code for that. See http://en.wikibooks.org/wiki/PostScript_FAQ#How_to_concatenate_strings.3F for instance.
(由mh更新:在此处复制)
(update by mh: copied here)
/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
这篇关于后记:连接两个字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文