Solved

stringlen in C#

Posted on 2008-06-10
2
260 Views
Last Modified: 2013-12-17
if (Strings.Len(cellvalue.Value2) > 0)
how would i write this properly in C#.
0
Comment
Question by:mathieu_cupryk
2 Comments
 
LVL 12

Accepted Solution

by:
jandromeda earned 500 total points
ID: 21756541
If Value2 is of type string then you can get the length of that using,
cellvalue.Value2.Length

So the above line would be,
if (cellvalue.Value2.Length > 0)
0
 
LVL 63

Expert Comment

by:Fernando Soto
ID: 21756545
Assumeing that cellvalue.Value2 is of type string you can do this.

if (cellvalue.Value2.Length > 0)
{
    // Then the length of the string has characters.
}
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question