---
title: Text.ToList – แปลงข้อความเป็น List ของตัวอักษร
url: https://www.thepexcel.com/functions/power-query/text-functions/text-tolist/
type: function-explainer
program: Power Query
syntax: Text.ToList(text as text) as list
date: 2025-12-03
updated: 2025-12-17
scores:
  popularity: 5
  difficulty: 3
  usefulness: 5
---

# Text.ToList – แปลงข้อความเป็น List ของตัวอักษร

> แยกข้อความเป็น List ของตัวอักษร

## คำอธิบาย

Text.ToList จะแยกข้อความหลักออกเป็น List ของ Text String โดยแต่ละสมาชิกใน List จะเป็นตัวอักษร 1 ตัว (รวมถึงช่องว่างและอักขระพิเศษ) ตามลำดับที่ปรากฏในข้อความต้นฉบับ

## Syntax

```excel
Text.ToList(text as text) as list
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| text | Yes | text |  | ข้อความที่ต้องการแปลงเป็น List ของตัวอักษร |

## เคสการใช้งาน

### วิเคราะห์ตัวอักษร

นับจำนวนตัวอักษรซ้ำ หรือตรวจสอบว่ามีตัวอักษรพิเศษใดบ้างในข้อความ

### สร้าง Password Masking

เปลี่ยนตัวอักษรแต่ละตัวในรหัสผ่านให้เป็นเครื่องหมาย '*' (ใช้ร่วมกับ List.Transform)

## ตัวอย่าง

### 1. ตัวอย่างที่ 1: แปลงคำว่า "apple"

```excel
Text.ToList("apple")
```

**ผลลัพธ์:** `{"a", "p", "p", "l", "e"}`

แยกคำว่า "apple" ออกเป็น List ของตัวอักษรแต่ละตัว

### 2. ตัวอย่างที่ 2: ใช้กับข้อความที่มีช่องว่าง

```excel
Text.ToList("Hello World")
```

**ผลลัพธ์:** `{"H", "e", "l", "l", "o", " ", "W", "o", "r", "l", "d"}`

ช่องว่างก็ถูกนับเป็นสมาชิกหนึ่งตัวใน List

### 3. ตัวอย่างที่ 3: ใช้ร่วมกับ List.Transform

```excel
List.Transform(Text.ToList("password"), each "*")
```

**ผลลัพธ์:** `{"*", "*", "*", "*", "*", "*", "*", "*"}`

แปลงตัวอักษรแต่ละตัวให้เป็นเครื่องหมายดอกจัน (*)

## คำถามที่พบบ่อย

**Q: Text.ToList ต่างจาก Text.Split อย่างไร?**

Text.ToList แยกข้อความเป็นตัวอักษรทีละตัวเสมอ ส่วน Text.Split แยกข้อความตามตัวคั่นที่กำหนด (ซึ่งอาจเป็นคำก็ได้)

## ฟังก์ชันที่เกี่ยวข้อง

- [Text.Split – แยกข้อความตามตัวคั่นที่กำหนด](https://www.thepexcel.com/functions/power-query/text-functions/text-split/)
- [List.Transform – แปลงค่าในลิสต์แต่ละตัว](https://www.thepexcel.com/functions/power-query/list-functions/list-transform/)

## แหล่งข้อมูลเพิ่มเติม

- [Microsoft Learn: Text.ToList](https://learn.microsoft.com/en-us/powerquery-m/text-tolist) _(Official Documentation)_
- [PowerQuery.how](https://powerquery.how/text-tolist/) _(guide)_

---

_Source: [https://www.thepexcel.com/functions/power-query/text-functions/text-tolist/](https://www.thepexcel.com/functions/power-query/text-functions/text-tolist/)_
