Questions tagged [charactercount]

67 questions
44
votes
11 answers

Count textarea characters

I am developing a character count for my textarea on this website. Right now, it says NaN because it seems to not find the length of how many characters are in the field, which at the beginning is 0, so the number should be 500. In the console in…
Ilan Biala
  • 3,093
  • 5
  • 32
  • 45
13
votes
4 answers

How can I count characters in Perl?

I have the following Perl script counting the number of Fs and Ts in a string: my $str = "GGGFFEEIIEETTGGG"; my $ft_count = 0; $ft_count++ while($str =~ m/[FT]/g); print "$ft_count\n"; Is there a more concise way to get the count (in other words,…
Daniel Standage
  • 7,189
  • 14
  • 61
  • 101
12
votes
4 answers

TinyMCE, show character count instead of word count

The title says it all. How do I get TinyMCE to show character count instead of word count?
Rusty
  • 7,112
  • 10
  • 46
  • 69
5
votes
1 answer

Number of characters in a string (not number of bytes)

In a string in objective-c if I say something like [myStr length]; it returns a number which is the number of bytes but what can I use to return the number of characters in a string. For example: a string with the letter "a" in it returns a length…
Albert Renshaw
  • 15,644
  • 17
  • 92
  • 173
5
votes
4 answers

Filtering a String based on word count

I am trying to filter a List of strings based on the number of words in each string. I am assuming that you would trim any white-space at the ends of the string, and then count the number of spaces left in the string, so that WordCount =…
Jeagr
  • 988
  • 6
  • 15
  • 26
5
votes
4 answers

TinyMCE Character Count incorrect

I am using TinyMCE on a textarea in my page. I am trying to get the character and word count and the textarea is typed into. I have been trying various versions to make it work correctly, but without success. Here's the latest buggy…
Devner
  • 5,855
  • 9
  • 53
  • 82
4
votes
4 answers

Why does jQuery.change() only trigger when I leave the element?

I have a textarea element and I want to print the number of characters written, above the textarea, as I'm typing. The HTML looks like this:

and the javascript: jQuery( "#text" ).change(…
Weblurk
  • 5,763
  • 16
  • 52
  • 101
4
votes
1 answer

Jquery Twitter Like Character Counter offsets for shortened Links

Hello I am trying to mimic the character counter on twitter. So when you type or paste the limit decreases. But the service I am writing this for will also have a url shortener so I want to offset it by the amount of characters the final URL will…
BillPull
  • 8,335
  • 15
  • 54
  • 93
3
votes
4 answers

Objective-c Line breaks every 10 characters (Keeping words in tact)

If I have a string that I am going to load into a TextField how can I make a line break \n occur every 10 characters (including spaces and whatnot) but not go to the next line mid-word... Like wrap the text with a max of 10 characters? But I'm not…
Albert Renshaw
  • 15,644
  • 17
  • 92
  • 173
3
votes
3 answers

Is there a way to count the number of characters per word for a string, returning values separated by a comma?

I have a list of strings in cells - 1000s of them - and I need to work out the characters per word but separated by word - preferably in 1 swift formula... For Example: 1. "Black Cup With Handle" > Formula I need > 5,3,4,6 "Giant Bear Statue" >…
3
votes
7 answers

How can I find the number of unique characters in a string?

I have found nothing particular for this purpose. I am trying to figure out a function that counts each of the characters' occurrences in a string, so that I can pull them out at the end from the length to find how many homogeneous characters are…
Edenia
  • 1,929
  • 1
  • 12
  • 28
3
votes
4 answers

Reliably getting a character count for .doc files

What's a reliable way to automatically count the characters and/or words in a .doc or .docx file? The only real requirement is a reasonably accurate and reasonably reliable count. It needs to work with documents containing something other than Latin…
deceze
  • 471,072
  • 76
  • 664
  • 811
2
votes
1 answer

Show characters count while typing in textarea Angular 5

I am trying to write a code to show characters count below the textarea field. I found many solutions for doing this but i don't know why its not working for me. Here is the code what i am trying:
dev tester
  • 307
  • 6
  • 22
2
votes
2 answers

Angular Conditional Class Based On Character Count

How to conditionally apply a class based on the character count of the model? E.g.: $scope.sample = 555; {{ sample }}
Steve
  • 4,435
  • 8
  • 36
  • 59
2
votes
3 answers

jquery validate with a character counter plugin

I have a page that has fields that are validated using jquery-validate plugin, and wanted to include a twitter like character counter on the fields to see how many chars are left Here is my…
Jay Rizzi
  • 3,922
  • 5
  • 33
  • 62
1
2 3 4 5