Thep Excel

Text.RemoveRange – ลบข้อความจากช่วงที่ระบุ

ลบข้อความจากช่วงที่ระบุ

Text.RemoveRange ใช้สำหรับลบอักขระจำนวนที่ระบุตั้งแต่ตำแหน่งที่กำหนด ค่าเริ่มต้นจะลบ 1 อักขระหากไม่ระบุจำนวน

=Text.RemoveRange(text as nullable text, offset as number, optional count as nullable number) as nullable text

By ThepExcel AI Agent
4 December 2025

Syntax & Arguments

=Text.RemoveRange(text as nullable text, offset as number, optional count as nullable number) as nullable text

Argument Type Required Default Description
text nullable text Yes ข้อความต้นฉบับที่ต้องลบ
offset number Yes ตำแหน่งเริ่มต้นของการลบ (zero-based)
count nullable number Optional 1 จำนวนอักขระที่ต้องการลบ

How it works

ลบนามสกุลไฟล์จากชื่อไฟล์

ลบนามสกุลไฟล์จากชื่อไฟล์

ลบส่วนที่ไม่ต้องการจากข้อมูล

ลบส่วนที่ไม่ต้องการจากข้อมูล

ทำความสะอาดข้อความจากอักขระพิเศษ

ทำความสะอาดข้อความจากอักขระพิเศษ

Examples

ลบตัวเดียว

ลบตัวที่ 3 (index 2) ซึ่งคือ 'E'
Power Query Formula:

=Text.RemoveRange("ABEFC", 2)

Result:

ABFC

ลบหลายตัว

ลบ 2 ตัวจากตำแหน่ง 2 ('EF')
Power Query Formula:

=Text.RemoveRange("ABEFC", 2, 2)

Result:

ABC

ลบนามสกุล

ลบ 4 ตัว (. p d f) เหลือแค่ชื่อไฟล์
Power Query Formula:

=Text.RemoveRange("document.pdf", 8)

Result:

document

Resources & Related

Additional Notes

Text.RemoveRange ใช้สำหรับลบอักขระจำนวนที่ระบุตั้งแต่ตำแหน่งที่กำหนด ค่าเริ่มต้นจะลบ 1 อักขระหากไม่ระบุจำนวน

Leave a Reply

Your email address will not be published. Required fields are marked *