[Groovy]concatで文字列の末尾文字列を追加する

2021年8月31日

書式
文字列A.concat(文字列B)
使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
class SampleArk {
static void main(String[] args) {
String strA = "study skill"
//文字列の末尾に文字列を追加
String strB=strA.concat(" in arkgame.com")
println "文字列の値"
println strA
println strB
println "文字列のクラス型"
println strA.class
println strB.class
}
}
class SampleArk { static void main(String[] args) { String strA = "study skill" //文字列の末尾に文字列を追加 String strB=strA.concat(" in arkgame.com") println "文字列の値" println strA println strB println "文字列のクラス型" println strA.class println strB.class } }
class SampleArk { 
   static void main(String[] args) { 
   
    String strA = "study skill"
    //文字列の末尾に文字列を追加
   String strB=strA.concat(" in arkgame.com")
  
  println "文字列の値"
  println strA
  println strB
  
  println "文字列のクラス型"
  println strA.class
  println strB.class
 

   } 
}

結果

文字列の値
study skill
study skill in arkgame.com
文字列のクラス型
class java.lang.String
class java.lang.String

Groovy

Posted by arkgame