Click here to Skip to main content
15,895,740 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

i am writing code for sending messages to mobiles.maximum 150 characters are send to 1 message.

if user enter more than 150 characters that time message send 2 times

(first message send 1 to 150 characters and 2nd message to send 151 To 300 characters).

how to write the code for do it. please give a solution for doing this.

Thank u.
Posted

Whats the problem you are facing in doing that.

Use loop to get the substring from the original message, and send it in a loop.

string msg="";
int count = msg.Length;
int x = 0;
while (x <= count)
{
     string imsg = msg.Substring(x, 150);
     //TODO: Send message logic here 
     x += 150;
}


I think this is what you required. :rose:
 
Share this answer
 
Do you know how to send a message to a mobile at all ? If not, then you're asking us to do your work entirely. What have you tried ? If so, how can you not know how to use the substring functions on the string class ?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900