string = H E L L O
index = 0 1 2 3 4
string length = 5 start from 0 to 4
substring(a, b) means take the strings from index a and stop before the index b
substring(2, 4) means take the strings from index 2 and stop before the index 4
that means take the strings in index 2 and 3 which are LL and this is the correct answer
refer to the baook pages 58, 59I hope it is clear
Ms. Malak















رد مع اقتباس
)











المفضلات