在 VB.net 中用双引号将值括起来 [英] Enclose values in double quotes in VB.net

查看:25
本文介绍了在 VB.net 中用双引号将值括起来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 vb.net 中有这个字符串.如果您能告诉我如何将值括在双引号中,我将不胜感激

I have this string in vb.net. I would appreciate if you can let me know how I can enclose the values in double quotes

dim str as string=""
str.Append("EmpID=" & empNo & " DeptID=" & deptID & "")

我希望字符串的值为 EmiID="10" DeptID="20"

I want the value of string to be EmiID="10" DeptID="20"

推荐答案

使用双双引号获取字符串中的单双引号

Use double double quotes to get a single double quote in the string

str.Append("EmpID=""" & empNo & """ DeptID=""" & deptID & """")

这篇关于在 VB.net 中用双引号将值括起来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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