zerowidth

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2024 License: MIT Imports: 3 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

ZeroWidth

텍스트에 폭이 없는 문자를 찾고 제거합니다.

설치

go get github.com/i31pc17/zerowidth

사용 방법

sample/sample.go 파일 참고

import (
    "fmt"
    "github.com/i31pc17/zerowidth"
)

func main() {
    zw := zerowidth.NewZeroWidth()
    
    zeroText := "(​) 폭이 없는 문자 제거 테스트 입니다."
    zeroRemove, err := zw.Remove(zeroText)
    
    fmt.Println("제거전 : ", zeroText)
    if err == nil {
        fmt.Println("제거후 : ", zeroRemove)
    }
    
    spaceText := "( ) 공백 제거 테스트 입니다."
    spaceRemove, err := zw.RemoveSpace(spaceText)
    
    fmt.Println("제거전 : ", spaceText)
    if err == nil {
        fmt.Println("제거후 : ", spaceRemove)
    }

    vaText := "(❤️) 변형 셀렉터 제거 테스트 입니다."
    vaRemove, err := zw.RemoveVarSelector(vaText)

    fmt.Println("제거전 : ", vaText)
    if err == nil {
        fmt.Println("제거후 : ", vaRemove)
    }
}
제거전 :  (​) 폭이 없는 문자 제거 테스트 입니다.
제거후 :  () 폭이 없는 문자 제거 테스트 입니다.
제거전 :  ( ) 공백 제거 테스트 입니다.
제거후 :  ()공백제거테스트입니다.
제거전 :  (❤️) 변형 셀렉터 제거 테스트 입니다.
제거후 :  (❤) 변형 셀렉터 제거 테스트 입니다.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FindChar

type FindChar struct {
	Position int
	Char     rune
}

type ZeroWidth

type ZeroWidth struct{}

func NewZeroWidth

func NewZeroWidth() *ZeroWidth

func (ZeroWidth) Find

func (_ ZeroWidth) Find(text string) ([]FindChar, error)

func (ZeroWidth) FindSpace

func (_ ZeroWidth) FindSpace(text string) ([]FindChar, error)

func (ZeroWidth) FindVarSelector

func (_ ZeroWidth) FindVarSelector(text string) ([]FindChar, error)

func (ZeroWidth) Remove

func (_ ZeroWidth) Remove(text string) (string, error)

func (ZeroWidth) RemoveSpace

func (_ ZeroWidth) RemoveSpace(text string) (string, error)

func (ZeroWidth) RemoveVarSelector

func (_ ZeroWidth) RemoveVarSelector(text string) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址