Skip to content

Instantly share code, notes, and snippets.

@son0nline
son0nline / ArrayJoin.cs
Created May 31, 2022 03:46
ArrayList join
using System.Collections;
using System.Collections.Generic;
public class ArrayJoin{
public ArrayJoin()
{
ArrayList arrayList = new ArrayList();
arrayList.Add(1);
arrayList.Add("two");
@son0nline
son0nline / VietNamChar.js
Created April 12, 2021 03:30
js: bỏ dấu Tiếng Việt
function removeVietnameseChar(str, bRPunctuations) {
// Bỏ các khoảng trắng liền nhau
str = str.replace(/ + /g, " ");
str = str.trim();
// Bỏ dấu tiếng Việt
str = str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g, "a");
str = str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g, "e");
str = str.replace(/ì|í|ị|ỉ|ĩ/g, "i");
str = str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g, "o");