12/27/2023 0 Comments Mudlet string functions![]() Two consecutive single quotes ('') are replaced by a single single quote in the output. Any sequence of characters that are enclosed in single quotes will be treated as text and not be used as an expression. Uses QDate::longMonthName().Īll other input characters will be ignored. MMM the abbreviated localized month name (e.g. MM the month as number with a leading zero (01-12) M the month as number without a leading zero (1-12) key functions for list mode integration: addfeature(String name, String type. Uses QDate::shortDayName().ĭddd the long localized day name (e.g. Controlling entities in Lua by calling C++ functions. ap will be replaced by either "am" or "pm".ĭ the day as number without a leading zero (1 to 31)ĭd the day as number with a leading zero (01 to 31)ĭdd the abbreviated localized day name (e.g. AP will be replaced by either "AM" or "PM".Īp or a use am/pm display. Zzz the milliseconds with leading zeroes (000 to 999)ĪP or A use AM/PM display. Z the milliseconds without leading zeroes (0 to 999) Ss the second with a leading zero (00 to 59) S the second without a leading zero (0 to 59) Mm the minute with a leading zero (00 to 59) M the minute without a leading zero (0 to 59) HH the hour with a leading zero (00 to 23, even with AM/PM display) H the hour without a leading zero (0 to 23, even with AM/PM display) Hh the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display) H the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display) If true, it will return the date and time as a string using a format passed to the "custom time format" arg or if none is supplied the default of "yyyy.MM.dd hh:mm:ss.zzz": If false, the function will return a table in the following format: 1523555867.191 getTime time = getTime(]) "return string" is a boolean value (in Lua anything but false or nil will translate to true). (optional) if provided, this will be the width of unprintable character, used display a non-character mark for these characters.GetEpoch () - will show e.g. This is a reverse operation of utf8.width(). utf8.widthindex utf8.widthindex(string, location]) Returns the character index at the location in the given string as well as the offset and the width. (optional) if provided, this will be the width of unprintable character, used display a non-character mark for these characters. (optional) if provided, the ambiguous width character's width is 2, otherwise it's 1. If the string is a code point, return the width of this code point. title ( "Привет" )) - 'ПРИВЕТ' utf8.width utf8.width(string]) Calculate the widths of the given string. ![]() %? - '?' stands for any other character: escape this character. T = - same as %nnn but has bracket around. ![]() addWordToDictionary(word): Adds the given word to the custom profile or shared. String.find() works with English text only, use utf8.find() for the international version. A collection of functions used to manipulate strings. If the pattern has captures, then in a successful match the captured values are also returned, after the two indices. Note that if plain is given, then init must be given as well. A value of true as a fourth, optional argument plain turns off the pattern matching facilities, so the function does a plain "find substring" operation, with no characters in pattern being considered "magic". A third, optional numerical argument init specifies where to start the search its default value is 1 and can be negative. Currently, it only takes one string as argument. If it finds a match, then find returns the indices of text where this occurrence starts and ends otherwise, it returns nil. To print information messages on the session screen you can use the echo( message ) function, or insertText( text ). ends ( line, "in bed" ) then echo ( "in bed \n " ) end string.find, utf8.find string.find(text, pattern ]) or utf8.find Looks for the first match of pattern in the string text. This will test if the incoming line ends with "in bed" and if not will add it to the end. word: custom word to add to the dictionary.See also: removeWordFromDictionary() Parameters Returns true on success (the word was actually added to the dictionary by this call) and nil+msg on error - including if the word was already there - this is so that if you have other scripts that you wish to run when a word was added you can make their execution conditional on success here. 1.26 string.patternEscape, utf8.patternEscapeĪ collection of functions used to manipulate strings.ĪddWordToDictionary addWordToDictionary(word) Adds the given word to the custom profile or shared dictionary (whichever is selected in preferences).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |