dart concat string and int
void main() {
int num = 5;
print("The number is $num");
}
dart concat string and int
void main() {
int num = 5;
print("The number is $num");
}
concatenate in flutter
In dart there are many string options.
For concatenation, you can do :
'hello $myVariable'
"hello ${myVariable.myProperty}"
'hello ' 'world' (only works with string literals)
'hello' + myVariable
So in your case, you can do a print(" $str1 $str2")
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us