How do I do if(string.endsWith("/")) in shell

I have a string that may or may not end with a '/' and would like to do something if it does not end in a slash. I have tried:

if "/home/test/blah/blah" | sed 's/\/$//'
then
    echo "OK"
fi

but I think sed works on input streams only and not files. I am not a shell programmer of any kind and am having difficulty in finding infomation on such things.

echo "/home/test/blah/blah"|grep '/$'
if [$? -eq 0];then
  echo "Ends with /"
fi

I think there are multiple ways to do this. Here is one using grep.
You could use grep to find out the last character and act accordingly.

See this

[/tmp]$ echo "/a/b/c/" | grep -qE "/$"
[/tmp]$ echo $?
0
[/tmp]$ echo "/a/b/c" | grep -qE "/$"
[/tmp]$ echo $?
1

$? holds the exit status. If the match was found, then the exit status is 0.
The -q flag is required so that in case of success, nothing is printed out.
The -E flag is allow regex matching. The $ denoted the end of the string. So "/$" denotes the end of string is a "/"

You don't need an external command for this; the shell's case statement does the job:

string=qwerty/
case $string in
     */) echo doing something;;
     *) echo not doing anything;;
esac

That's great thank you. I am a Java programmer and find shell scripting very difficult to get my head around. I couldn't get the solution provided by skar_a to work and so went with the one given by cfajohnson but thanks to all who replied.