package
Version:
v2.0.0-...-49787b7
Opens a new window with list of versions in this module.
Published: Apr 29, 2024
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Fill 为 id 填充后缀的 0
id 为原始值;
level 为需要达到的行政级别,最终的长度为 Length(level)。
Parent 获取 id 的上一级行政区域的 ID
330312123456 => 330312123
Prefix 获取 ID 的非零前缀
330312123456 => 330312123456
330312123000 => 330312123
func Split(id string) (province, city, county, town, village string)
Split 将一个区域 ID 按区域进行划分
SplitFilter 将 id 按区域进行划分且过滤掉零值的区域
330312123000 => 33 03 12 123
如果传递的是零值,则返回空数组。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.