แชร์ผ่าน


List.ReplaceRange

วากยสัมพันธ์

List.ReplaceRange(
    list as list,
    index as number,
    count as number,
    replaceWith as list
) as list

ประมาณ

แทนที่ค่า count ใน list ด้วยรายการ replaceWithโดยเริ่มต้นที่ตําแหน่งที่ระบุ index

ตัวอย่างที่ 1

แทนที่ {7, 8, 9} ในรายการ {1, 2, 7, 8, 9, 5} ด้วย {3, 4}

การใช้งาน

List.ReplaceRange({1, 2, 7, 8, 9, 5}, 2, 3, {3, 4})

ผลลัพธ์ของ

{1, 2, 3, 4, 5}