Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- namespace Emojify
- {
- /// <summary>
- /// Interaction logic for MainWindow.xaml
- /// </summary>
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- }
- private void Input_TextChanged(object sender, TextChangedEventArgs e)
- {
- try
- {
- bool looping = true;
- string outputText = " ";
- if (Input.Text == "") { goto End; }
- String inputString = Input.Text;
- char[] inputArray = inputString.ToCharArray();
- int i = inputArray.Length;
- while (looping)
- {
- loop:
- i--;
- if (i <= 0) { looping = false; }
- inputArray[i] = char.ToLower(inputArray[i]);
- string currentChar = Convert.ToString(inputArray[i]);
- if (currentChar == " ") { outputText = " " + outputText; goto loop; }
- if ((inputArray[i] >= 'a' && inputArray[i] <= 'z') || (inputArray[i] >= 'A' && inputArray[i] <= 'Z'))
- {
- outputText = ":regional_indicator_" + inputArray[i] + ": " + outputText;
- } else
- {
- outputText = inputArray[i] + " " + outputText;
- }
- }
- End:
- Output.Text = outputText;
- } catch { /* Don't care */ }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement