该字符串的正确语法是什么 [英] What is the proper syntax for this string

查看:153
本文介绍了该字符串的正确语法是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不知道我在这里真正要问什么问题,因此下面是我遇到麻烦的示例代码行.

我正在尝试在双引号内打印字符串的静态值,并在第一个字符串之后打印字符串的动态值.

请帮我.谢谢!

我尝试过的事情:

Don''t know what question should I really ask here so below is a sample line of code that I am having some trouble with.

I''m trying to print a static value for string that is inside the double quotations and a dynamic value for string after the first string.

Please help me. Thanks!

What I have tried:

variable = "Some string here " + variable.text

推荐答案

尝试:
variable = "Some string here " & variable

Or:

variable.Text = "Some string here " & variable.Text


似乎正在做一件奇怪的事情,但是我这是你想要做的事情:-
Seems a strange thing to be doing, but I this this is what you''re trying to do:-
variable = "Some string here " + variable


您可以尝试StrinBuilder,而不用字符串进行尝试.

//循环或您的声明
{
StringBuilder sb = new StringBuilder();
if(sb.length == 0)
{
sb.Append(此处有一些字符串");
}
sb.Append(variable);
}

您也可以用字符串完成
Instead of doing it in string, can you try StrinBuilder.

//Loop or your statement
{
StringBuilder sb = new StringBuilder();
if(sb.length==0)
{
sb.Append("Some string here");
}
sb.Append(variable);
}

you can do it in string also


这篇关于该字符串的正确语法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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