Show / Hide Table of Contents

Class StringExtensions

Extension for the string type

Inheritance
System.Object
StringExtensions
Namespace: FpAssistantCore.General
Assembly: FpAssistantCoreScl.dll
Syntax
public static class StringExtensions : object

Methods

View Source

ReplaceAtPosition(String, Int32, String)

Replace a section if text in a string with more text at a given position

Declaration
public static string ReplaceAtPosition(this string self, int position, string newValue)
Parameters
Type Name Description
System.String self

Existing string content

System.Int32 position

Position in string to remove from

System.String newValue

Text to be inserted in existing string

Returns
Type Description
System.String

Revised string with removed and replaced text

View Source

ToIA5Byte(Char)

Conversion of char to byte using 6 lower bits

Declaration
public static byte ToIA5Byte(this char character)
Parameters
Type Name Description
System.Char character
Returns
Type Description
System.Byte

Byte value of the char passed

Remarks

International Alphabet No. 5 (IA-5) is defined in ISO 646:1991 IRV and is identical to ASCII, but only the lower 6 bits of the value are used(bits 7/8 are zeroed). However, the PCL platform doesn't support Encoding.ASCII, but fortunately, UTF-8 encoding is identical for 7-bit characters(0-7F) so fits the bill for our purposes.

  • View Source
In This Article
Back to top Copyright 2018-2024 CADology Limited