Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Power BI
  3. Question
Power BI

How to truncate a string to a specific length if it is longer?

Asked by Brian Kennedy Apr 17, 2021 600 views 1 answer
Share

About this question

How can I make it that I can reduce the length of a String? Like for example the string.Length() = 300.

My goal is to make it to 120 characters, retaining the left side (e.g. NameOfThePerson to NameofThePers).

string sizeString = 'Imagine this is more than 120 Characters'; if(sizeString.Length() > 120){ //insert logic here to make it 120 characters
How can i truncate astring ?

Your answer

1 Answer

More Power BI discussions