Reverse String
来源:互联网 发布:国家博物馆淘宝 编辑:程序博客网 时间:2024/06/05 14:08
344. Reverse String
Write a function that takes a string as input and returns the string reversed.
Example:
Given s = “hello”, return “olleh”.
` public class Solution { public String reverseString(String s) { if (s == null || s.length == 0) return ""; StringBuilder builder = new StringBuilder(); char[] word = s.toCharArray(); for (int i = s.length()-1; i >= 0; i--) { builder.append(word[i]); } return builder.toString(); } }`
0 0
- Reverse string
- String Reverse
- reverse string
- string reverse
- reverse string
- reverse string
- Reverse String
- reverse string
- Reverse String
- Reverse String
- Reverse String
- Reverse String
- Reverse String
- Reverse String
- Reverse String
- Reverse String
- reverse string
- Reverse String
- 浅谈SVM(二)
- 复制文件或目录到指定目录下
- IntelliJ IDEA 14.x + Tomcat 运行 Java Web, 出现 Server is not connected. Deploy is not available.错误
- VC2013/MFC,异常: 0xC0000005
- android studio改包名
- Reverse String
- 构造、友元
- LUA是怎么样调用C++的函数的
- kerberos认证原理---讲的非常细致,易懂
- floor,ceil,round
- 设计,为了更好的应对变化
- android混淆相关
- servlet生命周期
- 设计模式-享元模式