Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

editing strings

Featured Replies

  • Author
  • Localization

spider91, posted Sat Jul 02, 2016 7:54 am (14955)


I have NAMEs like "0123ABCD_1", "4567EFAB_2", etc. How can i write last 2 simbols ("_1", "_2" and so on) to another variable, then remove it from NAME to finally get two separate parts. For example if i have NAME = "4567EFAB_5" it should transform to NAME = "4567EFAB" and INDEX = "_5"
  • Author
  • Localization

aluigi, posted Sat Jul 02, 2016 8:45 am (14956)


There are various solutions, in your specific case I would adopt the following:
Code:
set NAME string "4567EFAB_2"
string NAME s "%x_%d" VAR1 VAR2
print "%VAR1%"
print "%VAR2%"

Please note that the 's' operator of the String command works only with numbers so you cannot use %s
  • Author
  • Localization

spider91, posted Sat Jul 02, 2016 9:00 am (14962)


Thanks, and what is the solution if name looks like this "V81BobbyPreDisease07_7", simple names (not hex numbers) at the beginning and index at the end?
  • Author
  • Localization

aluigi, posted Sat Jul 02, 2016 9:04 am (14964)


Code:
set NAME string "4567EFAB_2"
set VAR1 string NAME
set VAR2 string NAME
string VAR1 > "_"
string VAR2 ! "_"
print "%VAR1%"
print "%VAR2%"
  • Author
  • Localization

spider91, posted Sat Jul 02, 2016 9:34 am (14965)


Perfect, thanks a lot.
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.