---
title: Code editor: multi-language
slug: th/user-guides/code-editor-multi-language
description: เอกสารฉบับนี้มีตัวแก้ไขโค้ดที่ครอบคลุม ซึ่งช่วยให้ผู้ใช้สามารถแสดงและคัดลอกตัวอย่างโค้ดได้อย่างง่ายดาย พร้อมความสามารถในการสร้างแท็บหลายอันและจัดเรียงใหม่ได้ด้วยการลากและวาง ช่วยให้ผู้ใช้จัดระเบียบได้สะดวกยิ่งขึ้น
createdAt: 2020-11-13T12:28:51.000Z
---

ตัวแก้ไขโค้ดของเราเป็นพื้นที่ที่คุณสามารถแสดงตัวอย่างโค้ดที่สามารถคัดลอกได้อย่างง่ายดาย

คุณสามารถเพิ่มแท็บหลายอันโดยใช้ภาษาเดียวกัน และใช้การลากแล้วปล่อยเพื่อจัดระเบียบแท็บใหม่

![](https://api.archbee.com/api/optimize/bNBm7nPJgXjbjLyfbHNh2/THSqdEtr4ZHb3KqpazPfo_f4dgqb8.gif)

เมื่อคุณเพิ่มแท็บใหม่ คุณยังสามารถเปลี่ยนชื่อให้เป็นเหมือนชื่อไฟล์ได้ เช่น`main.js`

ดูตัวอย่างของเรา:

:::CodeblockTabs
main.js

```javascript
fetch("https://api.cakes.com", {
  "method": "GET",
  "headers": {
    "Accept": "application/json"
  }
})
.then(response => {
  console.log(response);
})
.catch(err => {
  console.error(err);
});

```

```go
// We can use channels to synchronize execution
// across goroutines. Here's an example of using a
// blocking receive to wait for a goroutine to finish.
// When waiting for multiple goroutines to finish,
// you may prefer to use a [WaitGroup](waitgroups).

package main

import "fmt"
import "time"

// This is the function we'll run in a goroutine. The
// `done` channel will be used to notify another
// goroutine that this function's work is done.
func worker(done chan bool) {
    fmt.Print("working...")
    time.Sleep(time.Second)
    fmt.Println("done")

    // Send a value to notify that we're done.
    done <- true
}

func main() {

    // Start a worker goroutine, giving it the channel to
    // notify on.
    done := make(chan bool, 1)
    go worker(done)

    // Block until we receive a notification from the
    // worker on the channel.
    <-done
}

```

```python
# Python3 program to demonstrate 
# the use of sample() function . 
  
# import random  
import random 
  
  
# Prints list of random items of 
# length 3 from the given list. 
list1 = [1, 2, 3, 4, 5, 6]  
print("With list:", random.sample(list1, 3)) 
  
# Prints list of random items of 
# length 4 from the given string.  
string = "GeeksforGeeks"
print("With string:", random.sample(string, 4)) 
  
# Prints list of random items of 
# length 4 from the given tuple. 
tuple1 = ("ankit", "geeks", "computer", "science", 
                   "portal", "scientist", "btech") 
print("With tuple:", random.sample(tuple1, 4)) 
  
  
# Prints list of random items of 
# length 3 from the given set. 
set1 = {"a", "b", "c", "d", "e"} 
print("With set:", random.sample(set1, 3)) 
```

MacOS

```shell
```

```php
<?php
$name = "Quincy";
echo "Hi! My name is " . $name . "<br>";
echo "Hi! My name is " . $NAME . "<br>";
echo "Hi! My name is " . $NaMe . "<br>";
?>
```

```csharp
/*
 * C# Program to Check Whether the Entered Year is a Leap Year or Not
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace Program
{
    class leapyear
    {
        static void Main(string[] args)
        {
            leapyear obj = new leapyear();
            obj.readdata();
            obj.leap();
        }
        int y;
        public void readdata()
        {
            Console.WriteLine("Enter the Year in Four Digits : ");
            y = Convert.ToInt32(Console.ReadLine());
        }
        public void leap()
        {
            if ((y % 4 == 0 && y % 100 != 0) || (y % 400 == 0))
            {
                Console.WriteLine("{0} is a Leap Year", y);
            }
            else
            {
                Console.WriteLine("{0} is not a Leap Year", y);
            }
            Console.ReadLine();
        }
    }
}
```

```none
Hello World!
This is text.
```
:::

## มาร์กดาวน์

### บล็อกโค้ดที่มีแท็บเดียว

```nodejs
var http = require('http');

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World!');
}).listen(8080);
```

ใช้มาร์กดาวน์ต่อไปนี้เพื่อสร้างบล็อกโค้ดที่มีตัวอย่างโค้ดเดียว:

````markdown
## Code block

```nodejs
var http = require('http');

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World!');
}).listen(8080);
```
````

### Code blocks without language

:::CodeblockTabs
```text
// code block not specified
```

```text
// code block not specified
```

```text
// code block not specified
```
:::

Use the following Markdown to generate a code block without specifying the language:

````markdown
## Code blocks

:::::codeblocktabs

```
// code block not specified
```

```
// code block not specified
```

```
// code block not specified
```

:::::
````

### Code editor with multiple tabs

:::CodeblockTabs
```php
// PHP is the best.
```

```java
// and JAVA too
```

```go
// demo go
```

```javascript
// demo js
```
:::

ใช้ Markdown ต่อไปนี้เพื่อสร้างโค้ดบล็อกที่มีหลายแท็บ:

````markdown
## Demo Code Blocks

:::::codeblocktabs

```php
// PHP is the best.
```

```java
// and JAVA too
```

```go
// demo go
```

```javascript
// demo js
```

:::::
````

***

::::LinkArray
:::LinkArrayItem{headerType="IMAGE" headerImage="https://api.archbee.com/api/optimize/K_JWZranXy1tD6qvlG2v6-C1IcmVcG0rx4ZLHX6X7V7-20250911-192557.png"}
:FontAwesome[]{icon="fa-solid fa-cubes"} &#x20;**&#x20;ค้นหาบล็อกอื่น ๆ**

ค้นพบวิธีใหม่ ๆ และบล็อกต่าง ๆ เพื่อสร้างหน้าคู่มือที่สวยงามและใช้งานได้จริง

[ดูบล็อกทั้งหมด](docId\:fvbccw7nLvGJbcHvBvBG9)&#x20;
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://api.archbee.com/api/optimize/K_JWZranXy1tD6qvlG2v6-YRyGGWKsNS1ZZJa5XJy0z-20250911-192608.png"}
:FontAwesome[]{icon="fa-solid fa-headset"}**&#x20; ต้องการความช่วยเหลือ? ⬇️**

ใช้ **สีฟ้า** **ช่องแชท** จากมุมล่างขวา

หรือทดลองใช้ **AI Chat** เพื่อคำตอบอย่างรวดเร็ว
:::

:::LinkArrayItem{headerType="IMAGE" headerImage="https://api.archbee.com/api/optimize/K_JWZranXy1tD6qvlG2v6-MS_ubDHlXgoktt4svD2rL-20250911-192619.png"}
:FontAwesome[]{icon="fa-solid fa-hand-holding-heart"}**&#x20;  ความคิดเห็นของคุณมีความสำคัญ**

ใช้แบบฟอร์มข้อเสนอแนะด้านล่างโดยไม่ระบุชื่อ

หรือถามคำถามใน **ส่วน Q\&A** และทีมงานหรือ AI ของเราจะให้คำตอบแก่คุณ
:::
::::

