aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes String concat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "String concat" Watch "String concat" New topic
Author

String concat

Cindy Martin
Greenhorn

Joined: Jul 29, 2008
Posts: 10
Hi,

I want to concate two strings and compare that string to another one..But i could find that in ANT , the concat is only for the files.

For ex,

Str 1 = "abc"
Str 2 = "cdu"

I want to concat these two and compare that resultant string to another string.

Is there any way to do concat for two strings?

Kindly help,

Cindy
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi Cindy,

Can I ask what String s you are trying to concatenate and what purpose you are using it in the comparison for? I don't _think_ ANT directly supports what you are after but there might be another way around your problem.


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29253
    
140

Cindy,
You don't really have Strings in Ant - you have properties. It is possible to do what you want with two properties. Ant does the implicit concat for string properties.



If you have two actual Strings, they are probably in a scripting language like BSH. If this is the case, you could just use the concat operator in that scripting language.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: String concat
 
Similar Threads
Strings and immutability
Please help me
String literal and String object comparison
About Adler 32 checksum
How do I convert an object into a string?