Switch to: V13V12V11V10V9V8V7V6V5

Valentina Class: String Methods



    inStr as String ) as String        


  • inStr The string to be escaped.


This utility function is used if you build a string out of an SQL query, which may use a single quote or escape character. This allows you to escape a string (usually from user input) before you concatenate that string into a SQL query.


s1 = Valentina.EscapeString( "Valentina's (day)" )
// s1 is "Valentina\'s (day)"	
query = "SELECT * FROM T WHERE f1 = '" + s1 + "'" 


EnumTypeGetLocales( inStr as string) As VStringArray

This method should help you in case

  1. you use VENUM field type
  2. you have specified enum value strings for few languages
  3. you want to show them in GUI of your app

SQL command SHOW FIELDS returns all possible values of Enum types in some complex enough string in the field fld_specific_info.

  ('v1','v2','v3'), 'lang1':('lang1_v1','lang1_v2','lang1_v3'), 'lang2':('lang2_v1','lang2_v2','lang2_v3')
  or just:

This method helps you to parse it on items.

It returns the list of locale names as VStringArray array. Notice that first items belong to 'en' always.


dim languages as VStringArray = Valentina.EnumTypeGetLocaleItems( inStr )
// result is: { 'en', 'lang1', 'lang2' }


EnumTypeGetLocaleItems(inStr as string, inLocaleName as string) As VStringArray

The second helper method to parse VENUM string. It returns items for the specified locale name


dim itemsOfLang2 as VStringArray = Valentina.EnumTypeGetLocaleItems( inStr, 'lan2' )
// result is: { 'lang2_v1','lang2_v2','lang2_v3'}