The print statement is used to output text as-is, or output calculated results.

In Dart, there is no functional difference between double quotes ("") and single quotes ('').

dart
print("Hello");
print('Hello');

الاتنين String عادي جدًا. الاختيار يكون غالبًا حسب style وreadability:

  • استخدم نوع quotation يساعدك تقلل escape.
  • مثال:
dart
print("I'm Ali");   // أسهل من 'I\'m Ali'
print('He said "Hi"');

مهم: الاتنين يدعموا string interpolation عادي:

dart
var name = 'Ali';
print("Hi $name");
print('Hi $name');

وهنتعلم ال Escape characters