Skip to content

Instantly share code, notes, and snippets.

@ritalin
Created April 6, 2012 08:04
Show Gist options
  • Save ritalin/2318050 to your computer and use it in GitHub Desktop.
Save ritalin/2318050 to your computer and use it in GitHub Desktop.
Limitted String for .NET
namespace Sample {
public static class LimittedStringExtensions {
public string LimmitedString(this string inSelf, int inMaxLen) {
if (inSelf.Length > inMaxLen) {
throw new Exception("長すぎwwwワロタwww");
}
return inSelf;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment