惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
C
Check Point Blog
GbyAI
GbyAI
博客园 - 司徒正美
爱范儿
爱范儿
N
Netflix TechBlog - Medium
H
Hacker News: Front Page
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Security Latest
Security Latest
C
Cyber Attacks, Cyber Crime and Cyber Security
博客园 - Franky
Recent Announcements
Recent Announcements
P
Privacy International News Feed
T
Tor Project blog
Y
Y Combinator Blog
有赞技术团队
有赞技术团队
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
G
GRAHAM CLULEY
The Hacker News
The Hacker News
N
News and Events Feed by Topic
I
Intezer
The GitHub Blog
The GitHub Blog
S
SegmentFault 最新的问题
T
The Blog of Author Tim Ferriss
PCI Perspectives
PCI Perspectives
S
Secure Thoughts
P
Proofpoint News Feed
Microsoft Security Blog
Microsoft Security Blog
IT之家
IT之家
T
Threat Research - Cisco Blogs
J
Java Code Geeks
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
D
DataBreaches.Net
Hacker News - Newest:
Hacker News - Newest: "LLM"
Last Week in AI
Last Week in AI
H
Help Net Security
L
LangChain Blog
大猫的无限游戏
大猫的无限游戏
Help Net Security
Help Net Security
S
Schneier on Security
T
The Exploit Database - CXSecurity.com
Google Online Security Blog
Google Online Security Blog
Cyberwarzone
Cyberwarzone
T
Tailwind CSS Blog
V
Vulnerabilities – Threatpost
Forbes - Security
Forbes - Security
Apple Machine Learning Research
Apple Machine Learning Research
O
OpenAI News
AWS News Blog
AWS News Blog
月光博客
月光博客

博客园 - 但用此心

在CentOS中使用 yum 安装MongoDB及服务器端配置 yum安装mongodb 不错的文章 windows 下,go语言 交叉编译 linux 下 安装go go http 文件下载 go练习5--生成md5 go练习4--json 序列号反序列化 go练习3 --map的操作 go练习2-go的学习资料 php 定界符 mysql 修改默认配置 提高性能 eclipse 的代码着色插件 --Eclipse Color Theme 将tomcat添加为linux系统服务 在centos linux上安装jdk7 使用excel 展现数据库内容 java 查看线程死锁 linux 配置 java 环境变量 win7 安装windows 服务 报错 System.Security.SecurityException 解决方法 An exception occurred during the Install phase. System.Security.SecurityException: The so
go练习1-翻转字符串
但用此心 · 2014-09-12 · via 博客园 - 但用此心
//翻转字符串

func T1_1() {

	str := "你好helloworld!"
	fmt.Println("翻转前", str)
	var ret string
	for _, v := range str { //_ 占位使用
		ret = string(v) + ret
	}
	fmt.Println("翻转后", ret)
}

func T1_2() {
	str := "你好!go"
	fmt.Println("翻转前", str)
	tmp := []rune(str)
	strLen := len(tmp)
	ret := make([]rune, strLen)

	for i := 0; i < strLen; i++ {
		ret[i] = tmp[strLen-i-1]
	}
	fmt.Println("翻转后", string(ret))
}

func T1_3() {
	str := "你好!go"
	fmt.Println("翻转前", str)
	tmp := []rune(str)
	var ret string
	for i, j := 0, len(tmp)-1; i < j; i, j = i+1, j-1 {
		tmp[i], tmp[j] = tmp[j], tmp[i]
	}
	ret = string(tmp)
	fmt.Println("翻转后", ret)
}

  个人觉得第三种方法最优雅