Last active
November 21, 2016 06:22
-
-
Save nyanpasu64/6bef6850d1fe2b3cfa7eb442d0537ab5 to your computer and use it in GitHub Desktop.
University of California - An excellent word count system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var numInstancesCRLFs = countInstances(inputText, '\r\n'); | |
| if (numInstancesCRLFs > 0) { | |
| padLengthBy = numInstancesCRLFs * 4; | |
| charCounter = charCounter + padLengthBy; | |
| } | |
| else { | |
| var numInstancesLFCRs = countInstances(inputText, '\n\r'); | |
| if (numInstancesLFCRs > 0) { | |
| padLengthBy = numInstancesLFCRs * 4; | |
| charCounter = charCounter + padLengthBy; | |
| } else { | |
| var numInstancesCRs = countInstances(inputText, '\r'); | |
| if (numInstancesCRs > 0) { | |
| padLengthBy = numInstancesCRs * 4; | |
| charCounter = charCounter + padLengthBy; | |
| } else { | |
| var numInstancesLFs = countInstances(inputText, '\n'); | |
| if (numInstancesLFs > 0) { | |
| padLengthBy = numInstancesLFs * 4; | |
| charCounter = charCounter + padLengthBy; | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment