Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. When slapping yourself in the head is too good for you

When slapping yourself in the head is too good for you

Scheduled Pinned Locked Moved The Weird and The Wonderful
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chris Maunder
    wrote on last edited by
    #1
        public static string Pluralise(string text, int count, string culture = "en-US")
        {
            // The road to hell is paved with good intentions. 
            if (text.Length > 5 && text.EndsWithIgnoreCase(" need"))
            {
                string start = text.Substring(0, text.Length - 5);
    
                if (count == 1)
                    return start + " needs";
    
                return Pluralise(start, count, culture) + " need";
            }
    
             if (count == 1)
                return text;
    
            return PluralizationService.CreateService(new CultureInfo(culture)).Pluralize(text);
        }
    

    I'll go have a stern word with myself about this one...

    cheers Chris Maunder

    Z G 2 Replies Last reply
    0
    • C Chris Maunder
          public static string Pluralise(string text, int count, string culture = "en-US")
          {
              // The road to hell is paved with good intentions. 
              if (text.Length > 5 && text.EndsWithIgnoreCase(" need"))
              {
                  string start = text.Substring(0, text.Length - 5);
      
                  if (count == 1)
                      return start + " needs";
      
                  return Pluralise(start, count, culture) + " need";
              }
      
               if (count == 1)
                  return text;
      
              return PluralizationService.CreateService(new CultureInfo(culture)).Pluralize(text);
          }
      

      I'll go have a stern word with myself about this one...

      cheers Chris Maunder

      Z Offline
      Z Offline
      ZurdoDev
      wrote on last edited by
      #2

      Chris Maunder wrote:

      I'll go have a stern word with myself about this one...

      Chris Maunder wrote:

      Pluralise

      For spelling this wrong, no doubt. :-D

      There are only 10 types of people in the world, those who understand binary and those who don't.

      R 1 Reply Last reply
      0
      • C Chris Maunder
            public static string Pluralise(string text, int count, string culture = "en-US")
            {
                // The road to hell is paved with good intentions. 
                if (text.Length > 5 && text.EndsWithIgnoreCase(" need"))
                {
                    string start = text.Substring(0, text.Length - 5);
        
                    if (count == 1)
                        return start + " needs";
        
                    return Pluralise(start, count, culture) + " need";
                }
        
                 if (count == 1)
                    return text;
        
                return PluralizationService.CreateService(new CultureInfo(culture)).Pluralize(text);
            }
        

        I'll go have a stern word with myself about this one...

        cheers Chris Maunder

        G Offline
        G Offline
        Gary Wheeler
        wrote on last edited by
        #3

        It was as if millions of non-English speaking users cried out in anguish, and were suddenly silenced...

        Software Zen: delete this;

        1 Reply Last reply
        0
        • Z ZurdoDev

          Chris Maunder wrote:

          I'll go have a stern word with myself about this one...

          Chris Maunder wrote:

          Pluralise

          For spelling this wrong, no doubt. :-D

          There are only 10 types of people in the world, those who understand binary and those who don't.

          R Offline
          R Offline
          Rob Grainger
          wrote on last edited by
          #4

          Pluralise is correct English. Pluralize, as is commonly the case, is a US bastardisation of English.

          "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

          Z 1 Reply Last reply
          0
          • R Rob Grainger

            Pluralise is correct English. Pluralize, as is commonly the case, is a US bastardisation of English.

            "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

            Z Offline
            Z Offline
            ZurdoDev
            wrote on last edited by
            #5

            If the English knew how to speak and spell properly, we would have never left. :-\

            There are two kinds of people in the world: those who can extrapolate from incomplete data. There are only 10 types of people in the world, those who understand binary and those who don't.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups