求字符串处理函数(全)

求字符串处理函数(全),第1张

函数名: stpcpy

功 能: 拷贝一个字符串到另一个

用 法: char *stpcpy(char *destin, char *source)

程序例:

#include <stdio.h>

#include <string.h>

int main(void)

{

char string[10]

char *str1 = "abcdefghi"

stpcpy(string, str1)

printf("%sn", string)

return 0

}

函数名: strcat

功 能: 字符串拼接函数

用 法: char *strcat(char *destin, char *source)

程序例:

#include <string.h>

#include <stdio.h>

int main(void)

{

char destination[25]

char *blank = " ", *c = "C++", *Borland = "Borland"

strcpy(destination, Borland)

strcat(destination, blank)

strcat(destination, c)

printf("%sn", destination)

return 0

}

函数名: strchr

功 能: 在一个串中查找给定字符的第一个匹配之处

用 法: char *strchr(char *str, char c)

程序例:

#include <string.h>

#include <stdio.h>

int main(void)

{

char string[15]

char *ptr, c = 'r'

strcpy(string, "This is a string")

ptr = strchr(string, c)

if (ptr)

printf("The character %c is at position: %dn", c, ptr-string)

else

printf("The character was not foundn")

return 0

}

函数名: strcmp

功 能: 串比较

用 法: int strcmp(char *str1, char *str2)

看Asic码,str1>str2,返回值 >0;两串相等,返回0

程序例:

#include <string.h>

#include <stdio.h>

int main(void)

{

char *buf1 = "aaa", *buf2 = "bbb", *buf3 = "ccc"

int ptr

ptr = strcmp(buf2, buf1)

if (ptr >0)

printf("buffer 2 is greater than buffer 1n")

else

printf("buffer 2 is less than buffer 1n")

ptr = strcmp(buf2, buf3)

if (ptr >0)

printf("buffer 2 is greater than buffer 3n")

else

printf("buffer 2 is less than buffer 3n")

return 0

}

函数名: strncmpi

功 能: 将一个串中的一部分与另一个串比较, 不管大小写

用 法: int strncmpi(char *str1, char *str2, unsigned maxlen)

程序例:

#include <string.h>

#include <stdio.h>

int main(void)

{

char *buf1 = "BBB", *buf2 = "bbb"

int ptr

ptr = strcmpi(buf2, buf1)

if (ptr >0)

printf("buffer 2 is greater than buffer 1n")

if (ptr <0)

printf("buffer 2 is less than buffer 1n")

if (ptr == 0)

printf("buffer 2 equals buffer 1n")

return 0

}

函数名: strcpy

功 能: 串拷贝

用 法: char *strcpy(char *str1, char *str2)

程序例:

#include <stdio.h>

#include <string.h>

int main(void)

{

char string[10]

char *str1 = "abcdefghi"

strcpy(string, str1)

printf("%sn", string)

return 0

}

函数名: strcspn

功 能: 在串中查找第一个给定字符集内容的段

用 法: int strcspn(char *str1, char *str2)

程序例:

#include <stdio.h>

#include <string.h>

#include <alloc.h>

int main(void)

{

char *string1 = "1234567890"

char *string2 = "747DC8"

int length

length = strcspn(string1, string2)

printf("Character where strings intersect is at position %dn", length)

return 0

}

函数名: strdup

功 能: 将串拷贝到新建的位置处

用 法: char *strdup(char *str)

程序例:

#include <stdio.h>

#include <string.h>

#include <alloc.h>

int main(void)

{

char *dup_str, *string = "abcde"

dup_str = strdup(string)

printf("%sn", dup_str)

free(dup_str)

return 0

}

函数名: stricmp

功 能: 以大小写不敏感方式比较两个串

用 法: int stricmp(char *str1, char *str2)

程序例:

#include <string.h>

#include <stdio.h>

int main(void)

{

char *buf1 = "BBB", *buf2 = "bbb"

int ptr

ptr = stricmp(buf2, buf1)

if (ptr >0)

printf("buffer 2 is greater than buffer 1n")

if (ptr <0)

printf("buffer 2 is less than buffer 1n")

if (ptr == 0)

printf("buffer 2 equals buffer 1n")

return 0

}

函数名: strerror

功 能: 返回指向错误信息字符串的指针

用 法: char *strerror(int errnum)

程序例:

#include <stdio.h>

#include <errno.h>

int main(void)

{

char *buffer

buffer = strerror(errno)

printf("Error: %sn", buffer)

return 0

}

函数名: strcmpi

功 能: 将一个串与另一个比较, 不管大小写

用 法: int strcmpi(char *str1, char *str2)

程序例:

#include <string.h>

#include <stdio.h>

int main(void)

{

char *buf1 = "BBB", *buf2 = "bbb"

int ptr

ptr = strcmpi(buf2, buf1)

if (ptr >0)

printf("buffer 2 is greater than buffer 1n")

if (ptr <0)

printf("buffer 2 is less than buffer 1n")

if (ptr == 0)

printf("buffer 2 equals buffer 1n")

return 0

}

函数名: strncmp

功 能: 串比较

用 法: int strncmp(char *str1, char *str2, int maxlen)

程序例:

#include <string.h>

#include <stdio.h>

int main(void)

{

char *buf1 = "aaabbb", *buf2 = "bbbccc", *buf3 = "ccc"

int ptr

ptr = strncmp(buf2,buf1,3)

if (ptr >0)

printf("buffer 2 is greater than buffer 1n")

else

printf("buffer 2 is less than buffer 1n")

ptr = strncmp(buf2,buf3,3)

if (ptr >0)

printf("buffer 2 is greater than buffer 3n")

else

printf("buffer 2 is less than buffer 3n")

return(0)

}

函数名: strncmpi

功 能: 把串中的一部分与另一串中的一部分比较, 不管大小写

用 法: int strncmpi(char *str1, char *str2)

程序例:

#include <string.h>

#include <stdio.h>

int main(void)

{

char *buf1 = "BBBccc", *buf2 = "bbbccc"

int ptr

ptr = strncmpi(buf2,buf1,3)

if (ptr >0)

printf("buffer 2 is greater than buffer 1n")

if (ptr <0)

printf("buffer 2 is less than buffer 1n")

if (ptr == 0)

printf("buffer 2 equals buffer 1n")

return 0

}

函数名: strncpy

功 能: 串拷贝

用 法: char *strncpy(char *destin, char *source, int maxlen)

程序例:

#include <stdio.h>

#include <string.h>

int main(void)

{

char string[10]

char *str1 = "abcdefghi"

strncpy(string, str1, 3)

string[3] = ''

printf("%sn", string)

return 0

}

函数名: strnicmp

功 能: 不注重大小写地比较两个串

用 法: int strnicmp(char *str1, char *str2, unsigned maxlen)

程序例:

#include <string.h>

#include <stdio.h>

int main(void)

{

char *buf1 = "BBBccc", *buf2 = "bbbccc"

int ptr

ptr = strnicmp(buf2, buf1, 3)

if (ptr >0)

printf("buffer 2 is greater than buffer 1n")

if (ptr <0)

printf("buffer 2 is less than buffer 1n")

if (ptr == 0)

printf("buffer 2 equals buffer 1n")

return 0

}

函数名: strnset

功 能: 将一个串中的所有字符都设为指定字符

用 法: char *strnset(char *str, char ch, unsigned n)

程序例:

#include <stdio.h>

#include <string.h>

int main(void)

{

char *string = "abcdefghijklmnopqrstuvwxyz"

char letter = 'x'

printf("string before strnset: %sn", string)

strnset(string, letter, 13)

printf("string after strnset: %sn", string)

return 0

}

函数名: strpbrk

功 能: 在串中查找给定字符集中的字符

用 法: char *strpbrk(char *str1, char *str2)

程序例:

#include <stdio.h>

#include <string.h>

int main(void)

{

char *string1 = "abcdefghijklmnopqrstuvwxyz"

char *string2 = "onm"

char *ptr

ptr = strpbrk(string1, string2)

if (ptr)

printf("strpbrk found first character: %cn", *ptr)

else

printf("strpbrk didn't find character in setn")

return 0

}

函数名: strrchr

功 能: 在串中查找指定字符的最后一个出现

用 法: char *strrchr(char *str, char c)

程序例:

#include <string.h>

#include <stdio.h>

int main(void)

{

char string[15]

char *ptr, c = 'r'

strcpy(string, "This is a string")

ptr = strrchr(string, c)

if (ptr)

printf("The character %c is at position: %dn", c, ptr-string)

else

printf("The character was not foundn")

return 0

}

函数名: strrev

功 能: 串倒转

用 法: char *strrev(char *str)

程序例:

#include <string.h>

#include <stdio.h>

int main(void)

{

char *forward = "string"

printf("Before strrev(): %sn", forward)

strrev(forward)

printf("After strrev(): %sn", forward)

return 0

}

函数名: strset

功 能: 将一个串中的所有字符都设为指定字符

用 法: char *strset(char *str, char c)

程序例:

#include <stdio.h>

#include <string.h>

int main(void)

{

char string[10] = "123456789"

char symbol = 'c'

printf("Before strset(): %sn", string)

strset(string, symbol)

printf("After strset(): %sn", string)

return 0

}

函数名: strspn

功 能: 在串中查找指定字符集的子集的第一次出现

用 法: int strspn(char *str1, char *str2)

程序例:

#include <stdio.h>

#include <string.h>

#include <alloc.h>

int main(void)

{

char *string1 = "1234567890"

char *string2 = "123DC8"

int length

length = strspn(string1, string2)

printf("Character where strings differ is at position %dn", length)

return 0

}

函数名: strstr

功 能: 在串中查找指定字符串的第一次出现

用 法: char *strstr(char *str1, char *str2)

程序例:

#include <stdio.h>

#include <string.h>

int main(void)

{

char *str1 = "Borland International", *str2 = "nation", *ptr

ptr = strstr(str1, str2)

printf("The substring is: %sn", ptr)

return 0

}

函数名: strtod

功 能: 将字符串转换为double型值

用 法: double strtod(char *str, char **endptr)

程序例:

#include <stdio.h>

#include <stdlib.h>

int main(void)

{

char input[80], *endptr

double value

printf("Enter a floating point number:")

gets(input)

value = strtod(input, &endptr)

printf("The string is %s the number is %lfn", input, value)

return 0

}

函数名: strtok

功 能: 查找由在第二个串中指定的分界符分隔开的单词

用 法: char *strtok(char *str1, char *str2)

程序例:

#include <string.h>

#include <stdio.h>

int main(void)

{

char input[16] = "abc,d"

char *p

/* strtok places a NULL terminator

in front of the token, if found */

p = strtok(input, ",")

if (p) printf("%sn", p)

/* A second call to strtok using a NULL

as the first parameter returns a pointer

to the character following the token */

p = strtok(NULL, ",")

if (p) printf("%sn", p)

return 0

}

函数名: strtol

功 能: 将串转换为长整数

用 法: long strtol(char *str, char **endptr, int base)

程序例:

#include <stdlib.h>

#include <stdio.h>

int main(void)

{

char *string = "87654321", *endptr

long lnumber

/* strtol converts string to long integer */

lnumber = strtol(string, &endptr, 10)

printf("string = %s long = %ldn", string, lnumber)

return 0

}

函数名: strupr

功 能: 将串中的小写字母转换为大写字母

用 法: char *strupr(char *str)

程序例:

#include <stdio.h>

#include <string.h>

int main(void)

{

char *string = "abcdefghijklmnopqrstuvwxyz", *ptr

/* converts string to upper case characters */

ptr = strupr(string)

printf("%sn", ptr)

return 0

}

函数名: swab

功 能: 交换字节

用 法: void swab (char *from, char *to, int nbytes)

程序例:

#include <stdlib.h>

#include <stdio.h>

#include <string.h>

char source[15] = "rFna koBlrna d"

char target[15]

int main(void)

{

swab(source, target, strlen(source))

printf("This is target: %sn", target)

return 0

}

PS:isalpha()是字符函数,不是字符串函数,

isalpha

原型:extern int isalpha(int c)

用法:#include <ctype.h>

功能:判断字符c是否为英文字母

说明:当c为英文字母a-z或A-Z时,返回非零值,否则返回零。

举例:

// isalpha.c

#include <syslib.h>

#include <ctype.h>

#include <stdio.h>

main()

{

int c

clrscr() // clear screen

printf("Press a key")

for()

{

c=getchar()

clrscr()

printf("%c: %s letter",c,isalpha(c)?"is":"not")

}

return 0// just to avoid warnings by compiler

}

1、python处理字符串非常简单,获取url最后一个/之后的字符串,使用字符串函数rindex得到最后一个/位置,然后再对url字符串进行切片就可以得到url最后一个/后的字符串

2、代码:

url = 'http://zhidao.baidu.com/question/1242758094522051179.html'

ri = url.rindex('/')

ss = url[ri + 1:]

print(ss)

3、输出果:

1242758094522051179.html

4、函数说明:

rindex(...)

    S.rindex(sub[, start[, end]]) ->int

    从字符串右则查找指字符串,sub要查找了内容,start起始位置,end结束位置,函数返回位置。

5、字符串切片说明:

str[start:end]

获取字符串以start开始位置end位置之前的字符结束的字符,如果start为空为从字符串起始开始,如果end为空则到字符串末尾。以示例中代码为例url[ri + 1:]就是取url中ri+1位置到url结尾的子字符串。

// 鉴于市面上没有好用的移动端多选级联选择器,自己手写了一个

// 地区选择器

<template>

<view class="addressSelector">

<main>

<view class="provinceTree">

<view @click="getCityList(item, index)" :id="item.code" :class="item.checked === false ? 'provinceBox' : 'provinceBox provinceHeightLight'" v-for="(item, index) in provinceList" :key="item.code">

<span>{{item.name}}</span>

<i v-if="item.number !== ''">{{item.number}}</i>

</view>

</view>

<view class="cityTree">

<view @click="getAreaList(item, index)" :id="item.code" :class="item.checked === false ? 'cityBox' : 'cityBox cityHeightLight'" v-for="(item, index) in cityList" :key="item.code">

<span>{{item.name}}</span>

<i v-if="item.number !== ''">{{item.number}}</i>

</view>

</view>

<view class="areaTree">

<view @click="clickAreaList(item, index)" :id="item.code" :class="item.checked === false ? 'areaBox' : 'areaBox areaHeightLight'" v-for="(item, index) in areaList" :key="item.code">{{ item.name }}</view>

</view>

</main>

<u-top-tips z-index="99999" ref="uTips"></u-top-tips>

</view>

</template>

<script>

import { addressPartListApi } from '../../../api/api'

export default {

data() {

return {

// 省级城市编码

pcode: '',

// 市级城市编码

ccode: '110000',

// 省份列表

provinceList: [],

// 市级列表

cityList: [],

// 区县列表

areaList: [],

// 存储选中的省份列表

checkedProvinceList: [],

// 存储选中的市级列表

checkedCityList: [],

// 存储选中的区县级列表

checkedAreaList: []

}

},

onShow() {

// 获取省份列表

this.getProvinceList().then(() =>{

// 获取默认市级列表

this.getCityList({ code:'110000', pcode: '000000' }, 0)

})

},

methods: {

// 获取省份列表

async getProvinceList() {

const { data: res } = await addressPartListApi('000000')

if (res.code !== 0) return this. refs.uTips.show({ title: res.msg, type: 'error', duration: '2000'})

// 设置默认值

this.cityList = []

res.data.list.forEach((item, index) =>{

this.cityList.push({

id: item.id, // 地区id

name: item.name, // 地区名称

code: item.code, // 地区编码

pcode: item.pcode, // 父级地区编码

checked: false, // 选择状态

switch: false, // 切换状态

number: '', // 子级选中的值

index: index // 当前地区的下标

})

})

// 2.市级高亮

this.checkedCityList.forEach((checkCity, checkIndex) =>{

this.cityList.forEach((allCity, allIndex) =>{

if (checkCity.code === allCity.code) {

this.cityList[allIndex].checked = true

this.cityList[allIndex].number = this.checkedCityList[checkIndex].number

}

})

})

// 3.直接将所有区县级列表清空

this.areaList = []

// 4.将所有省份switch改为false,同时将当前选中的省份switch改为true

this.provinceList.forEach(zResult =>{

zResult.switch = false

})

this.provinceList[index].switch = true

return false

// 如果当前省级已经被点击过,但是不是第一次点击时

} else if (alreadyCheck === true &&value.switch === true) {

// 除了移除省级code还要移除对应省级下的所有市级code(移除对应的高亮状态,默认会重置)

// 将省级code和市级级pcode比较如果相同则移除(第一层)

if (this.checkedCityList.length !== 0) {

// --------------移除对应的市级code

let newCheckedCityList = []

this.checkedCityList.forEach((val, index) =>{

if (value.code !== val.pcode) {

newCheckedCityList.push(val)

} else {

// 将对应的市级code和区县级pcode比较如果相同则移除(第二层)

if (this.checkedAreaList.length !== 0) {

let newCheckedAreaList = []

this.checkedAreaList.forEach((keys, index) =>{

if (val.code !== keys.pcode) {

newCheckedAreaList.push(keys)

}

})

this.checkedAreaList = newCheckedAreaList

}

}

})

this.checkedCityList = newCheckedCityList

}

this.checkedProvinceList.splice(alreadyIndex, 1)

} else {

this.checkedProvinceList.push({ code: value.code, pcode: value.pcode, number: '全' })

}

console.log(this.checkedProvinceList, '省', this.checkedCityList, '市', this.checkedAreaList,'区县')

// 改变当前点击的省份高亮状态

this.provinceList[index].checked = !this.provinceList[index].checked

// 改变当前点击省份的全选状态

if (this.provinceList[index].number === '') {

this.provinceList[index].number = '全'

} else {

this.provinceList[index].number = ''

}

this.pcode = value.code

const { data: res } = await addressPartListApi(this.pcode)

if (res.code !== 0) return this. refs.uTips.show({ title: res.msg, type: 'error', duration: '2000'})

// 设置默认值

this.areaList = []

res.data.list.forEach((item, index) =>{

this.areaList.push({

id: item.id, // 地区id

name: item.name, // 地区名称

code: item.code, // 地区编码

pcode: item.pcode, // 父级地区编码

checked: false, // 选择状态

switch: false, // 切换状态

number: '', // 子级选中的值

index: index // 当前地区的下标

})

})

// 2.区县高亮

this.checkedAreaList.forEach((checkArea, checkIndex) =>{

this.areaList.forEach((allArea, allIndex) =>{

if (checkArea.code === allArea.code) {

this.areaList[allIndex].checked = true

}

})

})

// 3.将所有市级switch改为false,同时将当前选中的市级switch改为true

this.cityList.forEach(zResult =>{

zResult.switch = false

})

this.cityList[index].switch = true

return false

// 如果当前市级已经被点击过,但是不是第一次点击时

} else if (alreadyCheck === true &&value.switch === true) {

this.checkedCityList.splice(alreadyIndex, 1)

// 除了移除市级code还要移除对应市级下的所有区县级code同时移除对应的高亮状态

// 将市级code和区县级pcode比较如果相同则移除

if (this.checkedAreaList.length !== 0) {

let newCheckedAreaList = []

this.checkedAreaList.forEach((val, index) =>{

if (value.code !== val.pcode) {

newCheckedAreaList.push(val)

}

})

this.checkedAreaList = newCheckedAreaList

}

// 当市级已经被勾选时,找到对应的省级,省级后缀的数字得-1

this.provinceList.forEach((result, index) =>{

if (result.code === value.pcode) {

result.number = (result.number - 1) + ''

}

if (result.number === '0') result.number = '全'

// 不仅要改list的number还要改对应的checkedList上的number★~~~~~

if (this.checkedProvinceList.length !== 0) {

this.checkedProvinceList.forEach((redus, rIndex) =>{

if (redus.code === result.code) {

this.checkedProvinceList[rIndex].number = result.number

}

})

}

})

} else {

this.checkedCityList.push({ code: value.code, pcode: value.pcode, number: '全' })

// 勾选时点击当前市级地区时判断当前省级是否勾选,如果未勾选则勾选上(checked选择状态及高亮)

// 判断当前省级是否勾选

this.provinceList.forEach((result, index) =>{

// 找到对应的省级

if (result.code === value.pcode) {

// 如果省级未勾选,则勾选上省级

if (result.checked === false) {

result.checked = true

result.number = '全'

this.checkedProvinceList.push({ code: value.pcode, pcode: '000000', number: '1' })

}

// 到这一步肯定省级肯定是被勾选上了

// 如果市级被勾选,省级后缀的数字都得+1

if (result.number === '全') {

result.number = '1'

} else {

result.number = (result.number - 0 + 1) + ''

}

// 不仅要改list的number还要改对应的checkedList上的number★~~~~~

if (this.checkedProvinceList.length !== 0) {

this.checkedProvinceList.forEach((redus, rIndex) =>{

if (redus.code === result.code) {

this.checkedProvinceList[rIndex].number = result.number

}

})

}

}

})

}

// 改变当前点击的市级高亮状态

this.cityList[index].checked = !this.cityList[index].checked

// 改变当前点击市级的全选状态

if (this.cityList[index].number === '') {

this.cityList[index].number = '全'

} else {

this.cityList[index].number = ''

}

this.ccode = value.code

console.log(this.checkedProvinceList, '省', this.checkedCityList, '市', this.checkedAreaList,'区县')

const { data: res } = await addressPartListApi(this.ccode)

if (res.code !== 0) return this.$refs.uTips.show({ title: res.msg, type: 'error', duration: '2000'})

// 设置默认值

this.areaList = []

res.data.list.forEach((item, index) =>{

this.areaList.push({

id: item.id, // 地区id

name: item.name, // 地区名称

code: item.code, // 地区编码

pcode: item.pcode, // 父级地区编码

checked: false, // 选择状态

switch: false,// 切换状态

index: index // 当前地区的下标

})

})

// ------------------------------------------------------------------------------------------------(再获取完区县级列表后点击市级重置区县级高亮)

// 用所有被勾选的区县级code和所有区县列表进行比较如果相同则高亮

if (this.checkedAreaList.length !== 0 &&this.areaList.length !== 0) {

this.checkedAreaList.forEach((val, valIndex) =>{

this.areaList.forEach((keys, keysIndex)=>{

if (val.code === keys.code) {

this.areaList[keysIndex].checked = true

}

})

})

}

},

// 点击区县触发

clickAreaList(value, index) {

// 存储被点击的区县code(判断如果已经存在被点击过则去除)

let alreadyCheck = false

let alreadyIndex = ''

if (this.checkedAreaList.length !== 0) {

this.checkedAreaList.forEach((item, index) =>{

if (item.code === value.code) {

alreadyCheck = true

alreadyIndex = index

return false

}

})

}

// 如果当前县区级已经被勾选则去除

if (alreadyCheck === true) {

this.checkedAreaList.splice(alreadyIndex, 1)

// 去除的时候市级肯定是勾选状态

this.cityList.forEach((result, index) =>{

// 找到对应的市级,市级后缀的数字得-1

if (result.code === value.pcode) {

result.number = (result.number - 1) + ''

}

if (result.number === '0') result.number = '全'

// 不仅要改list的number还要改对应的checkedList上的number★~~~~~

if (this.checkedCityList.length !== 0) {

this.checkedCityList.forEach((redus, rIndex) =>{

if (redus.code === result.code) {

this.checkedCityList[rIndex].number = result.number

}

})

}

})

} else {

// 如果当前县区级如果未被勾选

this.checkedAreaList.push({ code: value.code, pcode: value.pcode })

// 勾选时点击当前区县地区时判断当前市级是否勾选,如果未勾选则勾选上(checked选择状态及高亮)

// 判断当前市级是否勾选

this.cityList.forEach((result, index) =>{

// 找到对应的市级

if (result.code === value.pcode) {

// 如果市级未勾选,则勾选上市级

if (result.checked === false) {

result.checked = true

result.number = '全'

this.checkedCityList.push({ code: value.pcode, pcode: '000000' })

//

}

// 到这一步肯定是被勾选上了

// 如果县区被勾选,市级后缀的数字都得+1

if (result.number === '全') {

result.number = '1'

} else {

result.number = (result.number - 0 + 1) + ''

}

// 不仅要改list的number还要改对应的checkedList上的number★~~~~~

if (this.checkedCityList.length !== 0) {

this.checkedCityList.forEach((redus, rIndex) =>{

if (redus.code === result.code) {

this.checkedCityList[rIndex].number = result.number

}

})

}

}

})

}

console.log(this.checkedProvinceList, '省', this.checkedCityList, '市', this.checkedAreaList,'区县')

// 改变当前点击的区县高亮状态

this.areaList[index].checked = !this.areaList[index].checked

}

}

}

</script>

<style lang="less">

.addressSelector{

main {

display: flex

width: 100%

background-color: #F5F5F5

.provinceTree, .cityTree, .areaTree {

flex: 1

height: 100vh

border-right: 1.81rpx solid #E4E4E4

overflow-y: auto

.provinceBox, .cityBox, .areaBox {

position: relative

height: 90.57rpx

line-height: 90.57rpx

text-align: center

i {

position: absolute

top: 30.8rpx

right: 30.79rpx

width: 28.98rpx

height: 28.98rpx

background-color: #188AFA

border-radius: 50%

line-height: 25.98rpx

color: #FFFFFF

font-size: 21.73rpx

}

}

// 省级高亮样式

.provinceHeightLight {

background: linear-gradient(270deg, #F5F5F5 0%, #D1E9FF 100%)

color: #188AFA

}

// 市级高亮样式

.cityHeightLight {

background-color: #F5F5F5

color: #188AFA

}

// 区县高亮样式

.areaHeightLight {

background-color: #F5F5F5

color: #188AFA

}

}

.cityTree, .areaTree {

background-color: #FFFFFF

}

}

}

</style>


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/7394765.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-05
下一篇 2023-04-05

发表评论

登录后才能评论

评论列表(0条)

保存