Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Development-process how to replace the values
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


nani
how to replace the values
1 Answer(s)      6 years ago
Posted in : Development process



Advertisement
View Answers

November 20, 2008 at 3:54 AM


Hi friend,


Code to solve the problem :

import java.util.*;
class ArrayList2
{
public static void main(String[] args)
{
ArrayList al = new ArrayList();
al.add("or");
al.add("c1");
al.add("or");
al.add("c2");
al.add("c3");
al.add("or");
al.add("c4");
System.out.println(al);

String temp = "";

for(int i=0;i<al.size();i++)
{

for(int j=i;j<al.size();j++)
{
if(al.get(i).equals("or"))
{
temp = al.get(i).toString();
al.set(i,al.get(j));
al.set(j,temp);
}

}
}
System.out.println(al);

}
}


Thanks


Related Tutorials/Questions & Answers:
how to replace the values - Development process
how to replace the values  i have arraylist containing "or","c1","or","c2","c3","or",c4" i want the output as "c1","c2","c3","c4","or","or"  Hi friend, Code to solve the problem : import java.util.*; class
PHP Array Replace
PHP Array Replace Sometimes we have to replace array values with given values, PHP provides array_replace() function to replace the values. array_replace... description of array_replace() is:  General Format array array
Advertisements
Replace
Replace   Hi, I have two text files in two diff locatons.The text file like below using java program 1)a.txt 1 abc bangalore 2 def adfsdf 3 ghij asdfdsad 2)b.txt A B C Now i want output is like below
ereg_replace() and eregi_replace().
ereg_replace() and eregi_replace().  What is the difference between eregreplace() and eregireplace()?   Hi friends, ereg_replace() is case sensitive like "Bharat"cannot be treated as "bharat"and eregi_replace
how to find a dynamic string in a string & how to replace tgat wth with another string - JSP-Servlet
how to find a dynamic string in a string & how to replace tgat wth with another string  Dear sir, i have a ArrayList in that i have stored a values from a excel sheet specified column values and i have one string
how to set the values in jsp
how to set the values in jsp  how to set the values text boxs in jsp frm dbase via servlet
PHP Array Replace Recursive
_replace_recursive() replaces the values of first array with the same values from... array, value of the second array will replace the values of first array. If a key...PHP Array Replace Recursive: PHP provides array_replace_recursive() function
MySql find and replace string
MySql find and replace string  How to find and replace string or special characters in MySql & PHP?   Find and Replace String PHP $result = preg_replace('/\band\b/i', 'foo', $subject
How to replace a head into another head
How to replace a head into another head. Get ready to learn a simple... face also. Here, I am going to replace a "Cow" head by a ".... Make Selection: Select which part you want to replace by the Polygonal Lasso
how to insert a summary values in grid
how to insert a summary values in grid  how to insert a summary value in grid
Replace TEXT
Replace TEXT   I have two text files in two diff locatons.The text file like below using java program 1)a.txt 1 abc bangalore 2 def adfsdf 3 ghij asdfdsad 2)b.txt A B C Now i want output is like below
How to get a values - JSP-Servlet
How to get a values  Dear sir, I have one input text field and one submit button .Within one file how to get a values within a same jsp. Thanks and Regards Harini Veerapur.  Hi Friend, Try the following
How can I get query string values in JavaScript?
How can I get query string values in JavaScript?  How can I get query string values in JavaScript?   To get a query string value, you can...) { name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); var regex
Replace JSF Standard Error Message
Replace JSF Standard Error Message  How can we replace the JSF Standard Error Message
How to get a values - JSP-Servlet
getting a null value aprt from a attachmented file,so how to get a other values...How to get a values  Dear sir, I have a one form with a multipart/form-data as follows To From Subject
Java String : Replace All
Java String : Replace All This section defines how to replace all character with specified character without using system methods. Replace All method : You can replace all specific character in a given string with another character
What is the difference between ereg_replace() and eregi_replace()?
What is the difference between ereg_replace() and eregi_replace()?  What is the difference between eregreplace() and eregireplace
replace character in php
replace character in php  PHP script that replace character
find and replace in java
find and replace in java  Need 'find and replace' function in Java to find special keyword in XMl such as @,#,!,%..and replace with their corresponding entities
How to show database values into graph using jsp?
How to show database values into graph using jsp?  How to show database values into graph using jsp
How to show database values into graph using jsp?
How to show database values into graph using jsp?  How to show database values into graph using jsp
how to read values from java in xml?
how to read values from java in xml?  how to read values from java in xml
Use of <fn:replace(String, String, String)> Tag of JSTL
Use of <fn:replace(String, String, String)> Tag of JSTL... will learn how to use <fn:replace> Tag of JSTL. This tag returns... : java.lang.String replace(java.lang.String
replace special characters in html
replace special characters in html  How can i replace the special characters in HTML?   Special Character in HTML HTML has a long list of special characters symbol that can be used anywhere throughout the HTML Code
How to get the request scope values? - Struts
How to get the request scope values?  Get value in Struts
how to insert values from jsp into ms access
how to insert values from jsp into ms access   how to insert values using jsp into ms access database
how to validate all form field values at once.
how to validate all form field values at once.  how to validate all form field values at once. condition:no form field shold contain sometext("--select
regexp_replace in update and replace query in postgres
regexp_replace in update and replace query in postgres  update message set data = replace (data, 'wmost','westernmost'); April 4, 2011 at 5:04 PM.... is there a way to avoid this problem. Can you send similar query using regexp_replace
How to pass multiple values from a servlet to JSP?
How to pass multiple values from a servlet to JSP?  hi, I want to pass multiple values form a servlet to JSP. Hw do i do that? I am able to send one...) values
dynamically how to change attiribute values in xml
dynamically how to change attiribute values in xml   Hi, I am facing the problem to update the Attribute values in XML file.dynamically how to change attribute values in XML . for example below is my XML structure. text
how to fetch values from .properties to a html file
how to fetch values from .properties to a html file  I have a .properties file with some key value pairs in it. I need to fetch the values from this .properties file into a html file.Please let me know how to do
 

 

 

DMCA.com