c# calulcation logic -


I'm looking to gather an argument to look at a particular number and tell on a simple collection basis That's what the second number is. Example - I can say that I have a string of letters and each 50 characters increase the integer to 1. So if I have 0 - 49 characters, counter = 1, if I have 50-99 characters, then counter = 2, if I have 100 - 14 9 characters, counter = 3 I thought I could type everything to do this, but I do not do such a thing as sometimes it will be round when it should always be round - that is, int (charcount / 50).

I wonder if I have to use the modulus operator. any suggestion?

For this precise example, you can increase the counter after your partition, so:

  int counter = (int) (stringToCheck.Length / 50) + 1  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -