aardio string.find error report

Don't talk nonsense, just go ahead!
Today I encountered a data match for reading the link page. Type error problem!
Probably report an error like this: aardio call function name:'find' error parameter: @1
screenshot of the specific situation!
Insert picture description here
Code forced conversion string

s ='tes'; //s实际是动态变量,有可能是string 也有可能是boolean
if(type(s)!='string'){
    
    
        s = tostring(s);
 };

type is a library in aardio, a method to determine the variable type. What was said is not accurate, and the specific official website did not explain it clearly, so I can only understand it directly!

aardio提供三个强制转换动态类型的函数

tostring(v) 转换参数v为字符串,可使用_tostring元方法自定义转换函数。
tonumber(v) 转换参数v为数值,可使用_tonumber元方法自定义转换函数。
topointer(v) 转换参数v为指针,可使用_topointer元方法自定义转换函数。

Guess you like

Origin blog.csdn.net/weixin_37254196/article/details/108751956