I have a property named "Version" in my bootstrapper project. It contains the version as a dot separated value (1.2.3). I only need to get the last numeric value.
How to perform a string operation within this WIX bootstrapper ? Is it possible or are there any other alternatives ?
You can use Expressions.
https://www.firegiant.com/wix/tutorial/com-expression-syntax-miscellanea/expression-syntax/
For your specific condition, ENDS WITH Expression should work ( >> )
Related
I'm trying to extract part of a file name using expressions in ADF expression builder. The part I'm trying to extract is dynamic in size but always appears between "_" and "-".
How can I go about doing this extraction?
Thanks!
Suppose there's a pipeline parameter named filename, you could use the below expression to extract value between '_' and '-', e.g. input 'ab_cd-', you would get 'cd' as output:
#{substring(pipeline().parameters.fileName, add(indexOf(pipeline().parameters.fileName, '_'),1),sub(indexOf(pipeline().parameters.fileName, '-'),3))}
You may want to check the documentation of Expressions and functions in Azure Data Factory for more details: https://learn.microsoft.com/en-us/azure/data-factory/control-flow-expression-language-functions#string-functions
got here Delphi 10.3 Update 1. On the Form I have a ADOQuery which has a Field named ExtraText this field is TWideStringField .
In my Programm I assign it like this :
PrintPosQueryRack.Value:=PrintPosQueryExtraText.Value;
if I hover the cursor over PrintPosQueryRack.Value I get System.WideString
if I hover the cursor over PrintPosQueryExtraText.Value I get System.String
I really-really don't understand why . The PrintPosQueryRack is a Calculated Field , which I Created as plain string . Because I as far as I know in later Delphi versions string is Unicode (UnicodeString) in Delphi .
I also have a variable here strRack : string . If I assign it to PrintPosQueryRack.Value ( which is System.WideString ) , I get the same Warrning .
I can "fix" this by changing the strRack : string to strRack : AnsiString
and by changing the PrintPosQueryExtraText.Value to PrintPosQueryExtraText.AnsiString .
But I am kinda lost here .
Thank you .
TL;DR: Use WideString as the type for your calculated field. StringFields are internally based on AnsiString.
If you make a field of type String, (ftString), you get a TStringField. Its value is still the "old" AnsiString. This is probably for compatibility reasons.
That is, it depends on the NEXTGEN define, which basically means the for classic desktop applications TStringField.Value is still an AnsiString, while for iOS and Android apps written in Delphi, it is indeed a (unicode) String.
But that is only for the Value property. You can also use the explicit AsString, AsWideString or AsAnsiString properties. Those properties are available for any field type, but the value you give or get is translated to and from the internal type of the field. For TStringFields, that type is still AnsiString, regardless how you set the value.
For unicode values, use WideString or WideMemo fields.
I defined:
STRING x; in a header (.h) file.
I have a function that I would like to check if the value x was assigned with a value, before I use it.
Something like:
if(x is null) then...
How can this be achieved in Installscript (InstallShield)?
I haven't used Installscript in years, but could you just use StrLengthChars? (example).
Resources:
The Installshield Community: https://community.flexerasoftware.com
InstallShield 2018 Help Library
Some Further Links:
InstallShield InstallScript: Strings
Using Null-Delimited Strings
Empty String comparison fails during Silent Install
IsEmpty. IsEmpty Example (Variants)
I am using spring integration in my project. I need to verify if one of the nodes value in my response contains a string by ignoring case sensitivity.
I have to see if the databaseName value contains DB2 by ignoring case sensitivity.
I am using the following expression to verify, but it's not working.
expression="T(java.util.regex.Pattern).compile(T(java.util.regex.Pattern).quote('DB2'), T(java.util.regex.Pattern).CASE_INSENSITIVE).matcher(#xpath(payload, '//databaseName')).find()"
I referred the following links before framing my expression:
https://docs.spring.io/spring/docs/current/spring-framework-reference/html/expressions.html
How to call a method of a class from expression in spring Integration
How to check if a String contains another String in a case insensitive manner in Java?
Am I missing anything in the expression?
As per Gary Russell's suggestion, The following expression worked for me.
#xpath(payload, '//databaseName').toLowerCase().contains('db2')
Using XPath 1.0 in XSLT SharePoint 2013, I have two objectives:
To extract 'Library Name' from:
/path/to/library/could/be/any/length/Library Name/file.extension
To extract document id QYZM2HKWQCSZ-3-3 from the following:
http://sharepoint01/sites/temp/_layouts/15/DocIdRedir.aspx?ID=QYZM2HKWQCSZ-3-3, QYZM2HKWQCSZ-3-3
How to extract the desired strings?
OAN, for some reason Document Id column return the full blown path to the resource as opposed to Id only.
Any suggestions, how to get Id only (to avoid substring preprocessing)?
For (1), write a recursive template as follows. Pass the input string as a parameter.
(a) if not(contains(substring-after($input, '/'), '/')) then return substring-before($input, '/')
(b) otherwise, make a recursive call passing (substring-after($input, '/')) as the parameter.
(c) add some error-handling logic to make sure you terminate if the input string doesn't contain a '/'.
Not possible in plain XPath 1.0 if you cannot find any further pattern in the path.
It seems the pattern ?ID= is fixed, and also the colon following the ID. If so, you can use substring-after(substring-before(., ','), '?ID='). Replace the context . by some XPath expression selecting the string.