ADVERTISEMENT
ADVERTISEMENT

Golang strings.ToLowerSpecial() Function with Examples

Golang | strings.ToLowerSpecial() Function: Here, we are going to learn about the ToLowerSpecial() function of the strings package with its usages, syntax, and examples.
Submitted by IncludeHelp, on August 23, 2021

strings.ToLowerSpecial()

The ToLowerSpecial() function is an inbuilt function of strings package which is used to get a copy of the string with all Unicode letters mapped to their lower case using the case mapping specified by unicode.SpecialCase type. It accepts two parameters – a unicode.SpecialCase type and a string, and returns the string with all Unicode letters mapped to their lower case based on the given SpecialCase type.

Syntax:

func ToLowerSpecial(c unicode.SpecialCase, str string) string

Parameter(s):

  • c : To specify the unicode.SpecialCase type.
  • str : The string to be used to get the lowercase.

Return Value:

The return type of ToLowerSpecial() function is a string, it returns a copy of the string with all Unicode letters mapped to their lower case using the case mapping specified by unicode.SpecialCase type.

Example 1:

// Golang program to demonstrate the
// example of strings.ToLowerSpecial() Function

package main

import (
	"fmt"
	"strings"
	"unicode"
)

func main() {
	fmt.Println(strings.ToLowerSpecial(unicode.TurkishCase, "Selam Dünya"))
	fmt.Println(strings.ToLowerSpecial(unicode.TurkishCase, "İyi Cümleler"))
}

Output:

selam dünya
iyi cümleler

Example 2:

// Golang program to demonstrate the
// example of strings.ToLowerSpecial() Function

package main

import (
	"fmt"
	"strings"
	"unicode"
)

func main() {
	fmt.Println(strings.ToLowerSpecial(unicode.TurkishCase, "Hello, world!"))
	fmt.Println(strings.ToLowerSpecial(unicode.TurkishCase, "(Hello, world!) İyi Cümleler"))
}

Output:

hello, world!
(hello, world!) iyi cümleler

Golang strings Package Functions »


ADVERTISEMENT



ADVERTISEMENT



Comments and Discussions


ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.