Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(Regular Expression) Letter Count
#2
The returned value of @text... is that the segment that will print, or the leftover text of the previously saved text (thinking the latter).
I'm at work so Pseudo-Code here:
Code:
old_length=@text.size
@text.gsub(/([?.!][^\n\z"])/) { "#{$1}\005[#{$game_system.message.end_delay}]" }
new_length=@text.size
printed_length = old_length - new_length
Note that I used gsub and not gsub! so I don't actually 'CUT' the string. That would be for later when you do the printing of the message.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png] [Image: liM4ikn.png] [Image: fdzKgZA.png] [Image: sj0H81z.png]
[Image: QL7oRau.png] [Image: uSqjY09.png] [Image: GAA3qE9.png] [Image: 2Hmnx1G.png] [Image: BwtNdKw.png%5B]
Above are clickable links

Reply }


Messages In This Thread
RE: (Regular Expression) Letter Count - by DerVVulfman - 03-14-2014, 10:57 PM



Users browsing this thread: