Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Truncate

Posted on February 21, 2013October 26, 2015 By David Kittell
public static string Truncate(string source, int length)
    {
        if (source.Length > length)
        {
            source = source.Substring(0, length);
        }
        return source;
    }
Originally Posted on February 21, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code CSharp

Post navigation

Next post

Related Posts

Ektron DMS File List

Posted on February 3, 2015October 26, 2015

Following my code on Ektron – DMS Content List I created this Ektron Widget <%@ Control Language="C#" AutoEventWireup="true" CodeFile="DMSFileList.aspx.cs" Inherits="widgets_DMSFileList" Debug="true" %> <asp:MultiView ID="ViewSet" runat="server" ActiveViewIndex="0"> <asp:View ID="View" runat="server"> <asp:Label runat="server" ID="lblDMSList">DMS Files</asp:Label> <asp:ListView ID="lvDMSList" runat="server" ItemPlaceholderID="aspItemPlaceholder" Visible="false"> <EmptyDataTemplate> <asp:Literal ID="litEmptyDataBasic" runat="server" Text="text" OnInit="litEmptyData_Init" /> </EmptyDataTemplate> <LayoutTemplate> <div class="form" style="max-width:…

Read More

Get Primary Key Column Name

Posted on July 31, 2014October 26, 2015

SELECT column_name FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE OBJECTPROPERTY(OBJECT_ID(constraint_name), ‘IsPrimaryKey’) = 1 AND table_name = ‘TableName’ Originally Posted on July 31, 2014Last Updated on October 26, 2015 All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it…

Read More

AWS CLI – List All VM Instances

Posted on April 6, 2018

for region in `aws ec2 describe-regions –output text | cut -f3` do echo -e "\nListing Instances in region:’$region’…" aws ec2 describe-instances –region $region done Reference: https://github.com/aws/aws-cli/issues/1777 All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development)…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes