Concatenation operator o Concatenation operators join multiple strings

  • Slides: 3
Download presentation
Concatenation operator o Concatenation operators join multiple strings into a single string o To

Concatenation operator o Concatenation operators join multiple strings into a single string o To concatenate string, use the & symbol or the + symbol o The string concatenation operator is not an arithmetic operator, but in precedence it does follow all arithmetic operators and precedes all comparison operators. Eg: Print “Con” & “Caten” & “ation” Print “Con” + “Caten” + “ation” The preceding statements set both to “ Concatenation “ Tilak De Silva BSc. Eng. , MSc, CEng , FIE(SL), FIET(UK), CITP(UK), FBCS(UK), MIEEE(USA)

VB comparison operators • ( all of equal precedence ) Operator – Operation: •

VB comparison operators • ( all of equal precedence ) Operator – Operation: • = equals • <> is not equal • < less than • > greater than • <= less than or equal • >= greater than or equal The comparison operators are lower in precedence than the arithmetic and higher in precedence than the Boolean operators. Tilak De Silva BSc. Eng. , MSc, CEng , FIE(SL), FIET(UK), CITP(UK), FBCS(UK), MIEEE(USA)

Logical operators compare Boolean expressions and return a Boolean result. And, Or, operators are

Logical operators compare Boolean expressions and return a Boolean result. And, Or, operators are binary because they take two operands. Not operator is unary because it takes a single operand. Eg : - • ( 23 > 14 ) And ( 11 > 8 ) Out put → True • ( 23 < 14 ) And ( 11 > 8 ) Out put → False • ( 23 > 14 ) And ( 11 < 8 ) Out put → False • ( 23 < 14 ) Or ( 11 > 8 ) Out put → True • ( 23 > 14 ) Or ( 11 < 8 ) Out put → True • ( 23 < 14 ) Or ( 11 < 8 ) Out put → False • Not ( 23 > 14 ) Out put → False • Not ( 23 > 67 ) Out put → True Tilak De Silva BSc. Eng. , MSc, CEng , FIE(SL), FIET(UK), CITP(UK), FBCS(UK), MIEEE(USA)