Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1021441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:18:41+00:00 2026-05-16T11:18:41+00:00

Last night I was messing around with Piglatin using Arrays and found out I

  • 0

Last night I was messing around with Piglatin using Arrays and found out I could not reverse the process. How would I shift the phrase and take out the Char’s “a” and “y” at the end of the word and return the original word in the phrase.

For instance if I entered “piggy” it would come out as “iggypay” shifting the word piggy so “p” is at the end of the word and “ay” is appended.

Here is the example code so you can try it as well.

    public string ay;
    public string PigLatin(string phrase)
    {
        string[] pLatin;
        ArrayList pLatinPhrase = new ArrayList();
        int wordLength;
        pLatin = phrase.Split();

        foreach (string pl in pLatin)
        {
            wordLength = pl.Length;
            pLatinPhrase.Add(pl.Substring(1, wordLength - 1) + pl.Substring(0, 1) + "ay");
        }

        foreach (string p in pLatinPhrase)
        {
            ay += p; 
        }
        return ay;
    }

You will notice that is example is not programmed to find vowels and append them to the end along with “ay”. Just simply a basic way of doing it.

If you where wondering how to reverse the above try this example of uPiglatinify

    public string way;
    public string uPigLatinify(string word)
    {
        string[] latin;
        int wordLength;
        // Using arrraylist to store split words.
        ArrayList Phrase = new ArrayList();
        // Split string phrase into words.
        latin = word.Split(' ');

        foreach (string i in latin)
        {
            wordLength = i.Length;
            if (wordLength > 0)
            {
                // Grab 3rd letter from the end of word and append to front
                // of word chopping off "ay" as it was not included in the indexing.
                Phrase.Add(i.Substring(wordLength - 3, 1) + i.Substring(0, wordLength - 3) + " ");
            }
        }

        foreach (string _word in Phrase)
        {
            // Add words to string and return.
            way += _word;
        }
        return way;
    }
  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:18:42+00:00Added an answer on May 16, 2026 at 11:18 am

    The work to split the phrase into words and recombine the words after transforming them is the same as in the original case. The difficulty is in un-pig-latin-ifying an individual word. With some error checking, I imagine you could do this:

    string UnPigLatinify(string word)
    {
        if ((word == null) || !Regex.IsMatch(word, @"^\w+ay$", RegexOptions.IgnoreCase))
            return word;
    
        return word[word.Length - 3] + word.Substring(0, word.Length - 3);
    }
    

    The regular expression just checks to make sure the word is at least 3 letters long, composed of characters, and ends with “ay”.

    The actual transform takes the third to last letter (the original first letter) and appends the rest of the word minus the “ay” and the original letter.

    Is this what you meant?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Last night when I'm developing an Android app using Eclipse, the computer suddenly out
Last night I did a load test on a site. I found that one
I began using WCF last night to setup a simple client server that will
I posted a question last night, but unfortunately I was not specific enough vis
Last night I attempted to play around with OpenGL in Xcode, but I couldn't
I only noticed this last night, as I have not used the toolbox on
Last night I asked a question like this, I'm not sure what's happening and
I was asked a question in C last night and I did not know
Last night someone on here really helped me out a lot with my first
Last night I tried to put together something that I have had working since

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.