如何在gnuplot中连接字符串? [英] How to concatenate strings in gnuplot?

查看:155
本文介绍了如何在gnuplot中连接字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我们有两个字符串:

Let's say we have two strings:

String1 = 'This is '
String2 = 'a mouse.'

如何将这两个字符串连接起来以在gnuplot中形成字符串'This is a mouse.'?

How can I concatenate these 2 strings to form the string 'This is a mouse.' in gnuplot?

推荐答案

给出两个字符串

String1 = 'This is ' 
String2 = 'a mouse.'

要连接它们,您可以使用其中一个

To concatenate them, you can use either

String3 = String1.String2

或更灵活:

String3 = sprintf("%s%s", String1, String2)

键入help stringhelp sprintf以获得有关这两种方法的更多信息.

type help string or help sprintf for more information about the two methods.

这篇关于如何在gnuplot中连接字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆