Top "Swap" questions

Changing position of two items.

How to swap String characters in Java?

How can I swap two characters in a String? For example, "abcde" will become "bacde".

java string swap
Swap two items in List<T>

Is there a LINQ way to swap the position of two items inside a list<T>?

c# linq swap
Python Simple Swap Function

I came across this problem when attempting to learn python. Consider the following function: def swap0(s1, s2): assert type(…

python swap
How to move specific item in array list to the first item

For example : A list A B C D E Given C , Switch to C A B D E Notice that …

java android collections arraylist swap
Is there a PHP function for swapping the values of two variables?

Say for instance I have ... $var1 = "ABC" $var2 = 123 and under certain conditions I want to swap the two around like …

php function swap
Is there a built in swap function in C?

Is there any built in swap function in C which works without using a third variable?

c swap
How to swap two numbers without using temp variables or arithmetic operations?

This equation swaps two numbers without a temporary variable, but uses arithmetic operations: a = (a+b) - (b=a); How …

c++ objective-c c swap
How to swap two string variables in Java without using a third variable

How do I swap two string variables in Java without using a third variable, i.e. the temp variable? String …

java string swap
Is it possible to swap columns around in a data frame using R?

I have three variables in a data frame and would like to swap the 4 columns around from "dam" "piglet" "fdate" "…

r swap
Swap rows with columns (transposition) of a matrix in javascript

For instance I have a matrix like this: |1 2 3| |4 5 6| |7 8 9| and I need it to convert into a matrix like this: |1 4 7| |2 5 8| |3 6 9| What …

javascript matrix multidimensional-array swap