string 还包括了以常见方式(可以结合这些方式来构成几种罕见的转换)转换字符串的函数。
string also includes functions that transform strings in common ways (which you can combine to form several uncommon transformations). For example
并编写一个简单使用动态sql的SQL用户定义函数(UDF),转换字符串中传入的公式并计算值。
And writing a simple SQL User Defined Function (UDF) that USES dynamic SQL to convert the formula passed in the string and calculate the value.
translate (out, in [,pad])用输入输出表转换字符串12345 . translate (“ qwertyuiop ”,“ 1234567890 ”)返回“ qwerty ”。
String.translate (out, in [, pad]) Translates the string using the in and out tables 12345.translate (" qwertyuiop ", "1234567890") returns "qwerty".
printf And then I'm gonna use the same printf line after that to actually plop it into this formatted string.
我还是要用到,来把它转换成格式化字符串。
How do we typically print things, we convert them to strings.
我们一般是怎么显示对象的呢?,对,把它们转换为字符串。
Well I need to take that number and I'm going to turn it into a string. So notice what I'm going to do right here. I take that number and convert it into a string. That's an example of that type conversion we did earlier on. By doing that it makes it possible for me to treat it as an ordered sequence of characters.
我可能得把这个数字变为字符串,请注意我这里是怎么做的,我把这个数字,转化为字符串了,这是我们之前学过的,类型转换的例子,这么一来我就能把它按照有序的。
应用推荐