mirror of
https://github.com/Myzel394/config-lsp.git
synced 2025-06-18 23:15:26 +02:00
18 lines
251 B
Go
18 lines
251 B
Go
package utils
|
|
|
|
import (
|
|
"regexp"
|
|
)
|
|
|
|
var trimIndexPattern = regexp.MustCompile(`^\s*(.+?)\s*$`)
|
|
|
|
func GetTrimIndex(s string) []int {
|
|
indexes := trimIndexPattern.FindStringSubmatchIndex(s)
|
|
|
|
if indexes == nil {
|
|
return nil
|
|
}
|
|
|
|
return indexes[2:4]
|
|
}
|