strutil

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatCommas

func FormatCommas[T Integer](num T) string

FormatCommas 숫자를 천 단위 구분 기호(,)가 포함된 문자열로 변환합니다. 예: 1234567 -> "1,234,567"

func MaskSensitiveData

func MaskSensitiveData(data string) string

MaskSensitiveData 민감한 정보를 마스킹합니다. 토큰, 키 등의 민감 정보를 안전하게 로깅하기 위해 사용합니다.

func NormalizeMultiLineSpaces

func NormalizeMultiLineSpaces(s string) string

NormalizeMultiLineSpaces 여러 줄 문자열의 각 줄을 정규화하고 연속된 빈 줄을 하나로 축약합니다. 앞뒤의 빈 줄도 제거됩니다.

func NormalizeSpaces

func NormalizeSpaces(s string) string

NormalizeSpaces 문자열의 앞뒤 공백을 제거하고 연속된 공백을 하나로 축약합니다. 예: " hello world " -> "hello world"

func SplitAndTrim

func SplitAndTrim(s, sep string) []string

SplitAndTrim 주어진 구분자로 문자열을 분리한 후, 각 항목의 앞뒤 공백을 제거하고 빈 문자열을 제외한 슬라이스를 반환합니다. 결과가 없거나 입력 문자열이 비어있는 경우 nil을 반환합니다. 예: "a, , b,c" (구분자 ",") -> ["a", "b", "c"]

func ToSnakeCase

func ToSnakeCase(str string) string

ToSnakeCase CamelCase 문자열을 snake_case로 변환합니다. 예: "MyVariableName" -> "my_variable_name"

Types

type Integer

type Integer interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64 |
		~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}

Integer 모든 정수 타입을 포괄하는 제네릭 인터페이스

Jump to

Keyboard shortcuts

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