13.9. Sass String function

发布时间 : 2025-10-25 13:35:45 UTC      

Page Views: 883 views

Sass String the (string) function is used to process strings and get relevant information.

The starting index value of the Sass string starts at 1, and remember that it is not 0.

The following table lists the string functions for Sass:

Function

Description & example

Quote (string)

Add quotation marks to the string.

Example:

Quote (runoob)

Result: “runoob”

Str-index (string, substring)

Returns the position where the substring substring first appears in the string. Returns null if there is no match to the substring.

Str-index (abcd, a) = > 1

Str-index (abcd, ab) = > 1

Str-index (abcd, X) = > null

Str-index (abcd, c) = > 3

Str-insert (string, insert, index)

Insert insert in the index position in the string string.

Example:

Str-insert (“Hello world!”, “runoob”, 6)

The result: “Hello runoob world!”

Str-length (string)

Returns the length of the string.

Example:

Str-length (“runoob”)

Results: 6

Str-slice (string, start, end)

The substring is intercepted from string, and the start and end position is set by start-at and end-at. If the end index value is not specified, it is intercepted to the end of the string by default.

Str-slice (abcd, 2,3) = > “bc”

Str-slice (“abcd”, 2) = > “bcd”

Str-slice (“abcd”,-3,-2) = > “bc”

Str-slice (“abcd”, 2-2) = > “bc”

To-lower-case (string)

Convert a string to lowercase

Example:

To-lower-case (“RUNOOB”)

Result: “runoob”

To-upper-case (string)

Convert a string to uppercase

Example:

To-upper-case (“runoob”)

Result: “RUNOOB”

Unique-id ()

Returns a random string without quotation marks as an id. However, it can only be guaranteed to ensure the uniqueness of this id in a single Sass compilation.

Example:

Unique-id ()

Result: uad053b1c

Unquote (string)

Remove quotation marks from a string

Example:

Unquote (“runoob”)

Results: runoob

《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。