Click here to Skip to main content
15,895,084 members
Home / Discussions / C#
   

C#

 
GeneralRe: how can i save the images,circles,rectangle,lines Pin
Wes Aday24-Sep-08 5:20
professionalWes Aday24-Sep-08 5:20 
GeneralRe: how can i save the images,circles,rectangle,lines Pin
maifs24-Sep-08 6:23
maifs24-Sep-08 6:23 
AnswerRe: how can i save the images,circles,rectangle,lines or etc together.. Pin
Pedram Behroozi24-Sep-08 6:12
Pedram Behroozi24-Sep-08 6:12 
AnswerRe: how can i save the images,circles,rectangle,lines or etc together.. Pin
oobimoo24-Sep-08 6:16
oobimoo24-Sep-08 6:16 
AnswerRe: how can i save the images,circles,rectangle,lines or etc together.. Pin
Pete O'Hanlon24-Sep-08 9:23
mvePete O'Hanlon24-Sep-08 9:23 
Questiontext split up! Pin
nesfrank24-Sep-08 3:56
nesfrank24-Sep-08 3:56 
AnswerRe: text split up! Pin
Ennis Ray Lynch, Jr.24-Sep-08 4:42
Ennis Ray Lynch, Jr.24-Sep-08 4:42 
AnswerRe: text split up! Pin
Guffa24-Sep-08 6:23
Guffa24-Sep-08 6:23 
Use the LastIndexOf method to find the last space within the first 30 characters and split the string there. Use the PadRight method to add spaces.

Example:
string msg = "Hi Jocey!! I Hope you have a stupendous 30th birthday! I'm aorry I can't make it! Suexoxo";

List<string> lines = new List<string>();
while (msg.Length > 30) {
	int pos = msg.LastIndexOf(' ', 29, 30);
	if (pos != -1) {
		lines.Add(msg.Substring(0, pos).PadRight(30));
		msg = msg.Substring(pos + 1);
	} else {
		lines.Add(msg.Substring(0, 30));
		msg = msg.Substring(30);
	}
}
lines.Add(msg.PadRight(30));

foreach (string s in lines) Console.WriteLine("\""+s+"\"");</string></string>


Despite everything, the person most likely to be fooling you next is yourself.

GeneralRe: text split up! Pin
nesfrank24-Sep-08 7:11
nesfrank24-Sep-08 7:11 
AnswerRe: text split up! Pin
Guffa24-Sep-08 8:10
Guffa24-Sep-08 8:10 
QuestionUnion on C# Pin
kk.tvm24-Sep-08 2:35
kk.tvm24-Sep-08 2:35 
AnswerRe: Union on C# Pin
Jimmanuel24-Sep-08 3:01
Jimmanuel24-Sep-08 3:01 
GeneralRe: Union on C# Pin
kk.tvm25-Sep-08 0:27
kk.tvm25-Sep-08 0:27 
GeneralRe: Union on C# Pin
Jimmanuel25-Sep-08 2:52
Jimmanuel25-Sep-08 2:52 
Questionsetup project related question Pin
laziale24-Sep-08 2:33
laziale24-Sep-08 2:33 
QuestionDesign patterns Pin
yadlaprasad24-Sep-08 1:46
yadlaprasad24-Sep-08 1:46 
AnswerRe: Design patterns Pin
Simon P Stevens24-Sep-08 1:51
Simon P Stevens24-Sep-08 1:51 
AnswerRe: Design patterns Pin
Abhijit Jana24-Sep-08 18:08
professionalAbhijit Jana24-Sep-08 18:08 
Questioninstance of sql server at client side Pin
laziale24-Sep-08 1:27
laziale24-Sep-08 1:27 
AnswerRe: instance of sql server at client side Pin
Simon P Stevens24-Sep-08 1:49
Simon P Stevens24-Sep-08 1:49 
GeneralRe: instance of sql server at client side Pin
laziale24-Sep-08 1:54
laziale24-Sep-08 1:54 
GeneralRe: instance of sql server at client side Pin
Simon P Stevens24-Sep-08 3:13
Simon P Stevens24-Sep-08 3:13 
AnswerRe: instance of sql server at client side Pin
HemJoshi24-Sep-08 23:06
HemJoshi24-Sep-08 23:06 
AnswerRe: instance of sql server at client side Pin
Guffa24-Sep-08 2:26
Guffa24-Sep-08 2:26 
AnswerRe: instance of sql server at client side Pin
darkelv24-Sep-08 4:00
darkelv24-Sep-08 4:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.