maxscript 中的转义问题
我对 maxscript 的编辑文本和字符串转义有一些问题。 首先,我想转义编辑文本中写入的字符串(重音符号和简单引号)。目的是将这个字符串提供给 mysql 查询。
然后我想限制编辑文本中每行的字符数,当达到视觉宽度时强制换行。
这些事情可以通过简单的方式实现吗?我不想解析字符串中的所有字符并手动插入换行符或空格特殊字符。
感谢任何帮助
I have some issues with the edittext of maxscript and string escaping.
First, I want to escape the string written in an edittext (accents and simple quotes). The purpose is to feed this string to a mysql query.
Then I’d like to limit the number of characters per line in the edittext, force line breaks when the visual width is reached.
Are those things possible in a simple way ? I do not want to parse all the charcaters in the string and insert line breaks or espace the special characters manually.
Thnaks for any help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
转义原始字符串很容易:
对于 mySQL,我可能会对引号这样做:
另外,如果您想转义制表符等,这也可以:
查看 http://www.asciitable.com 用于字符编号。
但请记住,该字符串将与转义字符一起存储,因此如果您读取该字符串,您也会显示转义字符。
这是用来做什么的?
您是否尝试在网页上显示 mySQL 的结果?
至于换行符,我认为没有办法获取 Maxscript EditText 框每行的字符串。但是,您可以在 Maxscript UI 中使用 .Net 文本框并以这种方式阅读。
Escaping the original string is easy:
For mySQL I'd probably do this for inverted commas:
Also if you wanted to escape TAB characters etc this would work:
Check out http://www.asciitable.com for character numbers.
But remember the string will be stored with the escape characters, so if you read the string you will display escape characters as well.
What is this being used for?
Are you trying to display the results on a web page from mySQL?
As for line breaks I don't think there's a way to get the string per line of a Maxscript EditText box. However you could use a .Net text box in your Maxscript UI and read it that way.