VBS,JAVA,ORACLE相关语言特性整理

序号 特性说明 VBS JAVA ORACLE 待续
1 逻辑判断if if  statement then
elseif statement then
if statement then
else if statement then
else
if statement then
elseif statement then
end if
可见脚本语言vbs,oracle语法一致,java则是不同它们
2 绝对值计算 abs(数字) abs(数字) abd(数字)  
  数字的平方根 sqr(数字) Math.sqrt(double) sqrt(数字)  
  取整函数,返回小于num int(数字)/fix(数字) ceil(),floor() ceil(),floor()  
  数字格式转换 formatnumber(number,小数保留位数,是否显示小数前0,负数用括号显示) numberformant抽象类,子类实例化 trunc()
round()
 
  日期格式转换 formatdate(date,pattern) simpledateformat trunc()  
  随机数 1-6 int(6*rnd()+1)   dbms_random.value(1,n)  
  四舍五入 round(number,num),
formatnumber支持不补零
  round(数字,位数),trunc(数字,位数)他不会四舍五入  
  数组的最大下标 ubound(数组名) .length-1  
  数组的最小下标 lbound(数组名) 0  
  数组声明 dim a
a=array(1,2,3,5)或者
dim a(10)
int a[]={};
int a[]=new int[15];
 
  数组数据过滤 filter(数组名,搜索的字符串)返回一个过滤过的数组  
  数组转换为字符串 join(array,patt) string.toarrray() char[]类型  
  数组的大小 ubound(数组名)-lbound(数组名)+1 .length  
  变量转换为整数类型 cint() int to_number(字符串),带有格式的字符串  
  变量转换为长整数类型 clng() long to_number(字符串),带有格式的字符串  
  变量转换为single类型 csng() float to_number(字符串),带有格式的字符串  
  变量转换为double类型 cdbl() double to_number(字符串),带有格式的字符串  
  变量转换为字符串 cstr() tostring to_char()  
  变量转换为日期 cdate() dateformat.parse() to_date()  
  变量转换为字节 cbyte() .    
  变量转换为布尔类型 cbool()      
  返回数字正负0值 sgn sign()    
  十六进制八进制 hex,oct      
  ANSI 字符代码 chr(数字),asc(字符)      
  时间 timer,time,date(),now()      
  时间截取 year(),month(),day(),weekday(),hour(),minute(),second()///datepart()      
  月份,星期字符串 monthname(),weekdayname()      
  日期相加 dateadd(类型,正数,日期)      
  两个时间段的间隔 datediff类型,日期1,日期2)      
  指定的年、月、日,返回 Date 子类型的 Variant dateserial(year,monthk,day)表达式      
  字符串智能转换为date,time DateValue、TimeValue      
  计算时间,毫秒 timer()      
  大小写字符串函数 lcase,ucase      
  去除字符串前后空格 ltrim,rtrim,trim()      
  子字符串索引--》字符串 right,left,mid      
  字符串的长度 len()      
  字符串替代函数 replace(str,restr,wanted)      
  分割字符串为一维数组 split(str,pattern)      
  字符串文本二进制比较 strcomp()      
  子字符串--》索引,判断字符串存在 instr(str,str2,pattern)
instrrev(str,str2,pattern)
     
 

返回具有指定长度的、重复字符组成的字符串。

字符也可以是字符代码,如果字符有好几个,则由第一个来重复组成返回的字符串
string(10,”*”)      
  字符串颠倒 strreverse(str)      
  指定数目的空格 space(数字)      
  判断类型和获取类型信息的函数 IsArray、IsDate、IsEmpty、IsNull、IsNumeric、IsObject,typename,vartype()      
  四个格式化函数 formatcurrency,formatnumber,formatdatetime,formatpercent()      
  脚本版本函数返回脚本语言(VBScript), 返回脚本引擎版本(8832), 返回脚本引擎主版本号(5), 返回脚本引擎次版本号 ScriptEngine ,ScriptEngineBuildVersion,ScriptEngineMajorVersion,ScriptEngineMinorVersion      
  设置当前的区域 GetLocale,SetLocale      
           
           
           
           
           
           
           
           
           
           
           
           
           
           
posted @ 2012-03-17 00:55  高级测试开发网  阅读(606)  评论(0编辑  收藏  举报
了解开发资源最新动态:https://seniortesting.club