แทนที่ HELLO ด้วย HI
=Text.ReplaceRange("HELLO WORLD", 0, 5, "HI")
HI WORLD
แทนที่ข้อความในช่วงที่ระบุ
Text.ReplaceRange ใช้สำหรับแทนที่อักขระในช่วงที่กำหนดด้วยข้อความใหม่ สามารถใช้ลบหรือแทรกข้อความ
=Text.ReplaceRange(text as nullable text, offset as number, count as number, newText as text) as nullable text
=Text.ReplaceRange(text as nullable text, offset as number, count as number, newText as text) as nullable text
| Argument | Type | Required | Default | Description |
|---|---|---|---|---|
| text | nullable text | Yes | ข้อความต้นฉบับ | |
| offset | number | Yes | ตำแหน่งเริ่มต้นของการแทนที่ | |
| count | number | Yes | จำนวนอักขระที่ต้องการแทนที่ | |
| newText | text | Yes | ข้อความใหม่ที่ต้องแทรก |
แก้ไขส่วนของข้อความที่กำหนด
แทนที่อักขระในตำแหน่งที่ระบุ
ปรับปรุงข้อความตามรูปแบบ
=Text.ReplaceRange("HELLO WORLD", 0, 5, "HI")
HI WORLD
=Text.ReplaceRange("HELLO WORLD", 6, 5, "UNIVERSE")
HELLO UNIVERSE
=Text.ReplaceRange("ABCD", 2, 0, "XX")
ABXXCD
Text.ReplaceRange ใช้สำหรับแทนที่อักขระในช่วงที่กำหนดด้วยข้อความใหม่ สามารถใช้ลบหรือแทรกข้อความ