I have a problem

#include<SoftwareSerial.h>
//SoftwareSerial mySerial(3, 4); // RX, TX
String voice;
int led1 = 5; //Connect LED 4 To Pin #13

void setup() {
Serial.begin(9600);
pinMode(led1, OUTPUT);
//pinMode(led2, OUTPUT);
// pinMode(led3, OUTPUT);

}
//-----------------------------------------------------------------------//
void loop() {
while (Serial.available()){ //Check if there is an available byte to read
delay(10); //Delay added to make thing stable
char c = Serial.read(); //Conduct a serial read
if (c == '#') {break;} //Exit the loop when the # is detected after the word
voice += c; //Shorthand for voice = voice + c
}
if (voice.length() > 0) {
Serial.println(voice);

//----------Turn On One-By-One----------//
if(voice == "*LIGHT ON") {digitalWrite(led1, HIGH);}

//----------Turn Off One-By-One----------//
else if(voice == "*LIGHT OFF") {digitalWrite(led1, LOW);}

//-----------------------------------------------------------------------//
voice="";}} //Reset the variable after initiating

What error i am doing because when i am giving command from phone the light is not getting ON

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

What are you seeing from your Serial.println(voice); ?

It would make life much simpler if you just send 'N' for ON and 'F' for OFF.

While it is unlikely to be the cause of your problem it is not a good idea to use the String (capital S) class on an Arduino as it can cause memory corruption in the small memory on an Arduino. Just use cstrings - char arrays terminated with 0.

And to make it easy for people to help you please modify your post and use the code button </> so your code looks like this and is easy to copy to a text editor. See How to use the Forum

...R