Skip to content

stonesteel1023/testForStringConcatenation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Test For String Concatenation

concat vs. +(operation) vs. StringBuilder

input

AB-12345678-CD

// delete hyphen and concatenate with strings

output

AB12345678CD

result

32bit environment

  • testConcat -> ---- nanoTime

  • testPlus -> ---- nanoTime

  • testStringBuilder -> ---- nanoTime

⇒ StringBuilder is the best way concatenate with strings

64bit environment

  • time to StringBuilder = 42973 nanoTime

  • time to Concat = 12985 nanoTime

  • time to Plus = 24423 nanoTime

⇒ Concat API is the best way

About

concat vs +(operation) vs StringBuilder

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages