Question: please I need help with this method:

```
String d = ret.getData(); //I get the string using this
int ui;
ui = d.indexOf("=", d.indexOf("=")+1);
do{
int f=d.indexOf("=", ui+1 );
System.out.println(d.substring(ui+1, f-1));//Here I'm showing the results of my code
ui = ui + d.indexOf("=", ui);}
while ((d.indexOf("=") + ui)!= 0);

```

The String I have is this one:

```
!re
=.id=*1
=name=ether1
=mtu=1500
=l2mtu=1600
=mac-address=D4:CA:6D:37:44:26
=arp=enabled
=auto-negotiation=true
=full-duplex=true
=speed=100Mbps
=running=true
=slave=false
=disabled=false

```

And the results of my code are:

```
*1
ether1
l2mt
24:22
nin

```

And what I want to get is:

```
*1
ether1
1500
1600
D4:CA:6D:37:44:26
enabled
true
true
100Mbps
true
false
false

```

I need to get everything that is after the "="

Please help! Thanks

Answer: 
Yes, it is. Maybe it is used for symmetry when setting values for flags:

```
#define FLAG_1  (1 << 0)
#define FLAG_2  (1 << 2)
#define FLAG_3  (1 << 3)
/* ... */

```

Don't worry about performances, a good compiler will be able to optimize such operations.

You can combine these values as follow:

```
/* Flags FLAG_1, FLAG_2 and FLAG_3 are set. */
f = FLAG_1 | FLAG_2 | FLAG_3;

```

And testing whether a given flag is set:

```
/* True if FLAG_1 is set. */
if (f & FLAG_1) { /* ... */ }

```
This is usually done to show that the definition represents a bit flag. Esp. when there are multiple flags defined together. In this case the magnitude of the shift defines the bit position that the definition represents. Defining it like that also makes things line up nicely:

```
#define FOO_FLAG (1 << 0)
#define BAR_FLAG (1 << 1)
#define BAZ_FLAG (1 << 2)

```

This can then be used when calling a function that expects a series of flags like so:

```
int ret = some_function(FOO_FLAG | BAR_FLAG) & BAZ_FLAG;

```

This then calls the function with bits `0` and `1` (FOO & BAR) and checks the return to see if bit `2` (BAZ) was set.