Related links
Sales & Asset management
Sales related services
Description of a part of the AM module - sales partFI - Finance Management
Framework Core functionality
- AyMINE Framework Server
- frmFrm – provided functionality
- System Rights
- System messaging
- AyMINE Business – Price calculation
- Strings and translations
- Export collection of objects
- AyMINE Framework management FAQ
- The AyMINE licence model
- AyMINE On-premise
- System events
- Mutli-client architecture
- Import collection of objects
- User sessions
- Default server methods
- Client-defined object attributes
- Common Libraries
Module - support for management
Libraries & Lincences
Mobile & Web Application
- Runtime debugging
- System console
- AyMINE Application
- In-line table edit support
- Object scripting API – object lang
- Application object structure
- Multilingual support
- View of a single object – detail
- Is using EVAL / feval method risky?
- Included library – String operations
- Cliplink
- Object API – object <g>
- API – Data object
- Object scripting API – object User
- Object view definition
- Framework support for Drag & Drop
- Common libraries
- Multiple-object update implementation
- fClip & fCliplist
- Offline persistent objects
- Mobile application
HR - Human Resources
System Management (part of framework)
Task, Project, Quality
Task & Task pattern
CMS - Content Management & Web API services
Included library – String operations
library of used string functions
- Simple lightweight string operation library for Typescript.
- No jQuery required! Unit tested, works with Angular.
- UPDATE
- Methods
- Methods
- Links to the aditional information
- Library copyright – MIT License
NOTE: Documentation in this document is part of the library. It does not include documentation of the internal framework library fstringFunctions and fobjectFunctions
Simple lightweight string operation library for Typescript.
No jQuery required! Unit tested, works with Angular.
import { String, StringBuilder } from 'typescript-string-operations';
USAGE:
String.Empty
var id = String.Empty;
String.IsNullOrWhiteSpace():
var id = image.GetId();
if(String.IsNullOrWhiteSpace(id))
return image;
String.Format():
var id = image.GetId()
String.Format("image_{0}.jpg", id)
output: "image_2db5da20-1c5d-4f1a-8fd4-b41e34c8c5b5.jpg";
Specifier available!
var value = String.Format("{0:L}", "APPLE"); //output "apple"
value = String.Format("{0:U}", "apple"); // output "APPLE"
value = String.Format("{0:d}", "2017-01-23 00:00"); //output "23.01.2017"
value = String.Format("{0:s}", "21.03.2017 22:15:01") //output "2017-03-21T22:15:01"
value = String.Format("{0:n}", 1000000);
//output "1.000.000"
value = String.Format("{0:00}", 1);
//output "01"
UPDATE
String Format for Objects including specifiers
var fruit = new Fruit();
fruit.type = "apple";
fruit.color = "RED";
fruit.shippingDate = new Date(2018, 1, 1);
fruit.amount = 10000;
String.Format("the {type:U} is {color:L} shipped on {shippingDate:s} with an amount of {amount:n}", fruit);
// output: the APPLE is red shipped on 2018-01-01 with an amount of 10.000
Specifier | Result |
---|---|
L | LowerCase |
U | UpperCase |
d | ShortDatePattern |
s | SortableDateTimePattern |
n | Thousand seperator |
00 | Padding numbers |
String.Join():
var value = String.Join("; ", "Apple", "Banana");
//output: "Apple; Banana";
OR
let object = { Name: "Foo", Value: "Bar" };
var value = String.Join('.', object);
//output: "Foo.Bar";
var array = ['Apple', 'Banana']
var value = String.Join("; ", array);
//output: "Apple; Banana";
Methods
Method | Type | Description | Parameter |
---|---|---|---|
Empty | Property | simply returns "" . | |
IsNullOrWhiteSpace | Method | returns true value if given parameter is either null, empty or undefined. | format , args |
Format | Method | Converts the value of objects to strings based on the formats specified and inserts them into another string. | format , args |
Join | Method | Combines arguments delimited by given seperator. | delimiter ,args |
Join | Method | Combines arguments delimited by given seperator from array. | delimiter ,array |
StringBuilder
Just like you know from C#,
var favoriteFruit: string = this.fruitService.getFavorite(); //Blueberries
var builder = new StringBuilder("My favorite fruits are: ");
builder.Append("Apples, ");
builder.Append("Bananas ");
// of course using String.Format()
builder.AppendFormat("and especially {0:U}!", favoriteFruit);
builder.AppendFormat(" I eat {0} every day!", 10);
var fruits = builder.ToString();
//output: "My favorite fruits are: Apples, Bananas and especially BLUEBERRIES! I eat 10 every day!";
Methods
Method | Type | Description | Parameter |
---|---|---|---|
Append | Method | appends a string. | value |
AppendFormat | Method | see description for String.Format() | format , args |
Clear | Method | clears the StringBuilder | |
ToString | Method | creates the actual string. |
Links to the aditional information
Library copyright – MIT License
Copyright (c) 2017 Sven Ulrich
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.