using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ArrayMaker
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
String txt = textBox2.Text;
this.Text = "Splitting string";
string[] arr = txt.Split(' ');
string del = "\",\"";
this.Text = "Joining array with delimeters";
string cod = string.Join(del, arr);
this.Text = "Adding prefix and suffix";
string fin = "var " + textBox1.Text + "=[\"" + cod + "\"];";
Clipboard.SetText(fin);
this.Text = "Done. Result copied to clipboard.";
}
private void Form1_Load(object sender, System.EventArgs e)
{
resize();
}
private void Form1_Resize(object sender, System.EventArgs e)
{
resize();
}
private void resize()
{
textBox1.Size = new Size(this.Width - 200, 20);
button1.Location = new Point(this.Width - 111, 4);
textBox2.Size = new Size(this.Width - 28, this.Height - 28);
}
}
}
Help a newb, please? Also, this is my first post here, so if i wrote the title wrong, broke the rules, or misspelled anything, just let me know.
Thanks in Advance!

New Topic/Question
Reply



MultiQuote







|