Efficient way to replace strings in java -


i have string template this:

http://server/{x}/{y}/{z}/{t}/{a}.json 

and have values:

int x=1,y=2,z=3,t=4,a=5; 

i want know efficent way replace {x} value of x, , y,z,t,z?

another way (c# way ;)):

messageformat mformat = new messageformat("http://server/{0}/{1}/{2}/{3}/{4}.json"); object[] params = {x, y, z, t, a}; system.out.println(mformat.format(params)); 

output:

http://server/1/2/3/4/5.json 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -