محب علوی
مدیر
Strings
اسٹرنگز (Strings) ایک حرف پر بھی مشتمل ہو سکتی ہے ۔
اسٹرنگز (Strings) محفوظ کرنے کے لیے حرف کو سنگل کوٹس (single quotes) میں لکھا جائے گا۔
اسٹرنگز (Strings) ایک سے زیادہ حرف پر بھی مشتمل ہو سکتی ہے ۔ حروف میں حروف تہجی اور گنتی کے اعداد بھی شامل ہو سکتے ہیں۔
ایک لفظ یا کئی الفاظ کا مجموعہ بھی ہو سکتا ہے حتی کہ ایک پورا جملہ یا کئی جملوں پر مشتمل تحریر بھی ایک اسٹرنگز کہلا سکتی ہے۔
اوپر موجود تمام اسٹرنگز کو سنگل کوٹس کی بجائے ڈبل کوٹس میں لکھا گیا ہے ۔
سنگل اور ڈبل کوٹس کے ساتھ ساتھ اسٹرنگز کو ٹرپل کوٹس میں بھی لکھا جاسکتا ہے ۔
اسٹرنگز (Strings) ایک حرف پر بھی مشتمل ہو سکتی ہے ۔
PHP:
str1 = 'a'
str2 = 's'
str3 = 'd'
اسٹرنگز (Strings) ایک سے زیادہ حرف پر بھی مشتمل ہو سکتی ہے ۔ حروف میں حروف تہجی اور گنتی کے اعداد بھی شامل ہو سکتے ہیں۔
PHP:
str_chars = ' a b'
str_chars = 'a 1 v'
str_chars = 'a b c d e 1 2 3'
ایک لفظ یا کئی الفاظ کا مجموعہ بھی ہو سکتا ہے حتی کہ ایک پورا جملہ یا کئی جملوں پر مشتمل تحریر بھی ایک اسٹرنگز کہلا سکتی ہے۔
PHP:
Mehfil_Birthday = "Urdu Mehfil's Birthday is in July"
Ahmad_Activity = "Ahmad has recently completed a course on coursera :) "
Nairang = "Nairang is always trying to play Naive"
سنگل اور ڈبل کوٹس کے ساتھ ساتھ اسٹرنگز کو ٹرپل کوٹس میں بھی لکھا جاسکتا ہے ۔
PHP:
Origin_of_Species = """ In 1859, the area of biological ignorance was very large. Nothing was known of the mechanisms of fertilization, heredity and variation, nor of embryonic differentiation; the scientific study of animal behaviour, biogeography and ecology had scarcely begun; no good paleontological series, like those of horse or elephant evolution, had been discovered, nor any fossils bearing on the ancestry of man; and the time-scale admitted by geologists and physicists was grossly inadequate. Yet in spite of this, Darwin in the Origin gave a remarkably good general picture of the evolutionary process, and followed out the implications of natural selection in a quite astonishing way."""
آخری تدوین: