Java concat() 方法

Java 教程 · 2019-02-08 19:59:20

concat() 方法用于将指定的字符串参数连接到字符串上。

语法

public String concat(String s)

参数

  • s -- 要连接的字符串。

返回值

返回连接后的新字符串。

实例

public class Test {
    public static void main(String args[]) {
        String s = "码农教程:";
        s = s.concat("www.codercto.com");
        System.out.println(s);
    }
}

以上程序执行结果为:

码农教程:www.codercto.com

点击查看所有 Java 教程 文章: https://www.codercto.com/courses/l/12.html

查看所有标签

The Art and Science of Java

The Art and Science of Java

Eric Roberts / Addison-Wesley / 2007-3-1 / USD 121.60

In The Art and Science of Java, Stanford professor and well-known leader in CS Education Eric Roberts emphasizes the student-friendly exposition that led to the success of The Art and Science of C. By......一起来看看 《The Art and Science of Java》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具