Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize string homoaddress inversion in golang

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

It is believed that many inexperienced people are at a loss about how to realize the reverse of string co-address in golang. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Demo

Package mainimport "fmt" func main () {str: = "map.baidu.com" fmt.Println (str) arr: = [] rune (str) for I, j: = 0, len (arr)-1; I < j I, j = arr 1, arr 1 {arr [I], arr [j] = arr [j], arr [I]} fmt.Println (string (arr), & arr [0]) for I, j: = 0,0; j < len (arr); for + {if string (arr [j]) = = "." {for n, m: = I, arr 1 N < m; n, m = naugh1, mmur1 {arr [n], arr [m] = arr [m], arr [n]} I = juni1} else if juni1 = = len (arr) {for n, m: = I, j; n < m N, m = nong1, arr 1 {arr [n], arr [m] = arr [m], arr [n]} fmt.Println (string (arr), & arr [0])}

Output

Liqiongtao:test liqiongtao$ go run main.go map.baidu.commoc.udiab.pam 0xc000090000com.baidu.map 0xc000090000, after reading the above, have you mastered the method of how to reverse the same address of a string in golang? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report